HwVERSION = 3.00 _framewk.h.0,!Arial, 0, 9, 5, 15, 12, 13, 3, 0 _topform _framewk.hPixelsClass1_form_topform _userloginHeight = 454 Width = 631 ShowWindow = 2 DoCreate = .T. AutoCenter = .T. Caption = "Top Form Frame window" cmenuname = ("") oapp = .NULL. Name = "_topform" form..\ffc\_base.vcx _framewk.h.0,PixelsPixels _application _framewk.happlication object superclassClass8 _framewk.h.0, _framewk.hitriesallowed 7 _containertimerGArial, 0, 9, 5, 15, 12, 13, 3, 0 Courier New, 1, 9, 7, 16, 12, 8, 4, 0  _application _applicationPixelsClass5_dialog _userlogin_label2 tmrRefreshcustom _userlogin14label..\ffc\_base.vcx:Top = 0 Left = 120 Interval = 500 Name = "tmrRefresh" _label!Arial, 0, 9, 5, 15, 12, 32, 3, 0  _navtoolbar1_label1Class11_modalawaretoolbar _navtoolbar _navtoolbar3 cmdFilterlrestoredenvironment lsavedenvironment saveenvironment restoreenvironment beforereadevents resetformscollection lgomenu_assign Init Destroy 45 _userlogin..\ffc\_app.vcx71 commandbutton_commandbuttonlabelformClass..\ffc\_base.vcxcustom14 _navtoolbar?superclass for framework-supplied default dialog for user login..\ffc\_base.vcx_label _userlogin18form_traceawaretimer _application cusTableNav _separator2 separator _tablenavDTop = 3 Left = 205 Height = 29 Width = 58 Name = "_separator2" ..\ffc\_base.vcx..\ffc\_table.vcxform txtPasswordPixelsuPROCEDURE Click IF NOT ISNULL(THIS.Parent.oApp) THIS.Parent.oApp.ShowTableSetFilterDialog() ENDIF ENDPROC  _separatorspnGo _application _navtoolbar cmdSortDown _tablesort commandbuttonClasstextbox..\ffc\_base.vcx_textbox_newopen _userlogintxtNametextboxcustomTop = 3 Left = 205 Height = 24 Width = 24 Picture = graphics\filter.bmp Caption = "" SpecialEffect = 2 ZOrderSet = 8 Name = "cmdFilter" _splash..\ffc\_base.vcx _navtoolbarClass cusTableSort1_textboxPixels _framewk.vcx!Arial, 0, 9, 5, 15, 12, 32, 3, 0 _standardtoolbarClass..\ffc\_table.vcx..\ffc\_base.vcxCTop = 0 Left = 96 Height = 19 Width = 23 Name = "cusTableNav" _commandbuttonshapecmenuname Holds a unique menu name for association with this form so that it can be RELEASEd EXTENDED when the form is destroyed. oapp AutoSize = .T. FontName = "MS Sans Serif" FontSize = 8 BackStyle = 0 Caption = "Password:" Height = 15 Left = 8 Top = 60 Width = 51 Name = "_label2"  commandbutton _framewk.h _applicationcusWindowHandlerClass cmdSortUp commandbutton_newopen..\ffc\_ui.vcxiPROCEDURE Click IF NOT ISNULL(THIS.Parent.oApp) THIS.Parent.oApp.DoSort(,,,.T.) ENDIF ENDPROC ..\ffc\_base.vcxDTop = 0 Left = 72 Height = 19 Width = 23 Name = "cusTableSort"  _framewk.h.0,_commandbutton _navtoolbar_windowhandlercustomJArial, 0, 9, 5, 15, 12, 13, 3, 0 MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0 _documentpicker _framewk.vcxHTop = 0 Left = 48 Height = 19 Width = 23 Name = "cusWindowHandler" FTop = 0 Left = 25 Height = 19 Width = 23 Name = "cusDataSession"  _applicationTop = 3 Left = 174 Height = 24 Width = 24 Picture = graphics\sortdes.bmp Caption = "" SpecialEffect = 2 ZOrderSet = 7 Name = "cmdSortDown" cusDataSession _datasessioniPROCEDURE Click IF NOT ISNULL(THIS.Parent.oApp) THIS.Parent.oApp.DoSort(,,,.F.) ENDIF ENDPROC spinner..\ffc\_base.vcxcustomFontBold = .T. FontName = "Courier New" Height = 24 Left = 68 SelectOnEntry = .T. Top = 19 Width = 294 Name = "txtName" ..\ffc\_app.vcx?Top = 0 Left = 0 Height = 19 Width = 23 Name = "cusError"  _applicationcusError..\ffc\_app.vcxformzPROCEDURE InteractiveChange IF NOT ISNULL(THIS.Parent.oApp) THIS.Parent.oApp.GoToRecord(THIS.Value) ENDIF ENDPROC _errorPixels1 _framewk.h.0,_Height = 24 Left = 97 SpecialEffect = 2 Top = 3 Width = 55 ZOrderSet = 5 Name = "spnGo" _spinner _navtoolbar_form containershape _framewk.h.0,formPixelsPixels cmdBottom _navtoolbar _framewk.h commandbutton..\ffc\_base.vcx_commandbuttoncmdNext commandbuttonPixels..\ffc\_base.vcx_favoritepicker_documentpicker cmdRemoveformJsuperclass for framework-supplied default dialog to add or edit a document_favoritepicker_favoritepickerPixels commandbutton_commandbutton _navtoolbarcmdPrev..\ffc\_base.vcx_commandbuttonePROCEDURE Click IF NOT ISNULL(THIS.Parent.oApp) THIS.Parent.oApp.GoBottom() ENDIF ENDPROC 5PROCEDURE Click THISFORM.RemoveDocument() ENDPROC ClassClass_errorlogviewer _framewk.h cmdBrowse commandbuttonformClass _navtoolbar_dialogcmdTopFontBold = .T. FontName = "Courier New" Height = 24 Left = 68 SelectOnEntry = .T. Top = 55 Width = 294 PasswordChar = "*" Name = "txtPassword"  commandbutton_errorlogviewer_errorlogviewer app_mediatorJArial, 0, 9, 5, 15, 12, 13, 3, 0 MS Sans Serif, 0, 8, 7, 16, 13, 14, 3, 0 customspnNav_dialog_options,Top = 36 Left = 48 Name = "app_mediator"  _framewk.vcx _formmediator..\ffc\_base.vcx{DoCreate = .T. Name = "_newopen" lstDocuments.Name = "lstDocuments" cmdOK.Name = "cmdOK" cmdCancel.Name = "cmdCancel" form_errorlogviewercmdBrowseErrorLog commandbuttonspinner_commandbutton..\ffc\_base.vcx_favoritepicker..\ffc\_base.vcx_commandbutton _framewk.h.0,_commandbutton_errorlogviewerClass_documentpicker_spinnerJArial, 0, 9, 5, 15, 12, 13, 3, 0 MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0  _framewk.h_documentpickerqArial, 0, 9, 5, 15, 12, 13, 3, 0 Courier New, 32, 9, 7, 15, 12, 8, 3, 0 MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0 ..\ffc\_base.vcx_errorlogviewer_documentpicker txtErrStamptextbox..\ffc\_base.vcx_textbox edtUserNotescmdHelp commandbutton _navtoolbarQsuperclass for framework-supplied dialogs manipulating the metatable of documents cmdCancel commandbuttoncmdOK!_errorlogviewer.pgfErrorLog.Page2Top = 3 Left = 151 Height = 24 Width = 24 Picture = graphics\sortasc.bmp Caption = "" SpecialEffect = 2 ZOrderSet = 6 Name = "cmdSortUp" _commandbutton!Arial, 0, 9, 5, 15, 12, 13, 3, 0 _formeditbox..\ffc\_base.vcx..\ffc\_base.vcx _separator1 separatorClass..\ffc\_base.vcx_editbox!_errorlogviewer.pgfErrorLog.Page1Pixels separatorTop = 3 Left = 74 Height = 24 Width = 24 Picture = graphics\bottom.bmp Caption = "" SpecialEffect = 2 ZOrderSet = 4 Name = "cmdBottom" ..\ffc\_base.vcxPixels edtListingeditboxcmdOK _aboutbox..\ffc\_base.vcx _separatoroapp _editbox_errorlogviewer pgfErrorLog pageframe..\ffc\_base.vcx_splash_splash _pageframe lblCreditsAutoSize = .T. FontName = "MS Sans Serif" FontSize = 8 BackStyle = 0 Caption = "Name:" Height = 15 Left = 8 Top = 24 Width = 33 Name = "_label1" Height = 100 Width = 375 DoCreate = .T. BufferMode = 1 Caption = "User Login" KeyPreview = .T. AlwaysOnTop = .T. itries = 0 itriesallowed = 3 Name = "_userlogin" superclass for framework-supplied default dialog to add items to the Favorites menu (in New mode) or execute a document at startup ("quick start")_commandbutton_documentpickercustom commandbutton _framewk.vcxcPROCEDURE Click IF NOT ISNULL(THIS.Parent.oApp) THIS.Parent.oApp.GoNext() ENDIF ENDPROC toolbar_shape _framewk.h.0,_changepassword _framewk.hlabel_modalawaretoolbar_standardtoolbarcmdCopy_label_standardtoolbar commandbuttonsuperclass for framework-supplied default navigation toolbar (application object makes a nav toolbar class available to any form designated as using a nav toolbar in the metatable)..\ffc\_ui.vcx..\ffc\_base.vcx_commandbuttonimage_dialog cmdCancel.PROCEDURE Click THISFORM.Release() ENDPROC ..\ffc\_base.vcx_commandbutton lstDocumentsXsuperclass for "frame" or "parent window", for MDI applications existing outside _screen..\ffc\_base.vcx _formmediator_label_documentpicker _framewk.h..\ffc\_base.vcx_shape_changepassword_changepasswordlabelcmdCut _framewk.vcxtsuperclass for framework-supplied dialog to execute or modify (in New mode -- not yet implemented) a report document _framewk.h commandbutton_commandbuttonrsuperclass for framework-supplied default startup toolbar (exists throughout the life of the application, if used)_standardtoolbarbsuperclass for framework-supplied default dialog to browse error log and add user notes to the log0PROCEDURE Click THISFORM.Release() ENDPROC 7superclass for framework-supplied default splash screen..\ffc\_base.vcx_splashlblApplicationNamelabel_labelNTop = 3 Left = 213 Height = 31 Width = 3 Style = 1 Name = "_separator4" cmdPaste..\ffc\_base.vcx_label _separator4gPROCEDURE Click IF NOT ISNULL(THIS.Parent.oApp) THIS.Parent.oApp.GoPrevious() ENDIF ENDPROC  _reportpickerhPROCEDURE Click IF VARTYPE(THIS.Parent.oApp) = "O" THIS.Parent.oApp.DoHelp() ENDIF ENDPROC  _separatorPcalias imargin ctextdisplayfont *donologmessage *ctextdisplayfont_assign textboxlistboxformPixels_changepassword commandbutton..\ffc\_base.vcx_splashimgApplicationimage..\ffc\_base.vcx_standardtoolbar _separator1..\ffc\_base.vcx_textbox commandbuttonBsuperclass for framework-supplied default password-changing dialoglabel..\ffc\_base.vcx_commandbutton_commandbutton_standardtoolbarcmdPrintpArial, 0, 9, 5, 15, 12, 13, 3, 0 Courier New, 1, 9, 7, 16, 12, 8, 4, 0 MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0 _changepasswordlblConfirmPassword commandbutton _framewk.h.0,_custom..\ffc\_base.vcx_changepasswordlabel_dialog_options..\ffc\_base.vcxshpGlobalItems _framewk.vcxcustomzPROCEDURE Click IF VARTYPE(THIS.Parent.oApp) = "O" THIS.Parent.oApp.DoMenuItemInFrame("PASTE") ENDIF ENDPROC _commandbutton _framewk.h.0,JArial, 0, 9, 5, 15, 12, 13, 3, 0 MS Sans Serif, 0, 8, 5, 13, 11, 11, 2, 0 Usuperclass for framework-supplied default dialog to edit, apply, or save user options_dialog _framewk.h.0,imgApplication_optionsGPROCEDURE Click THISFORM.SavePassword() THISFORM.Release() ENDPROC txtConfirmPassword..\ffc\_base.vcx_label..\ffc\_base.vcx lblCredits _aboutbox _aboutbox_changepassword lblPassword txtPasswordform_standardtoolbar..\ffc\_base.vcx_changepasswordtextbox..\ffc\_base.vcx..\ffc\_base.vcx_listbox_textboxform _framewk.vcx _framewk.vcx_optionsPixels commandbutton..\ffc\_base.vcx_commandbutton_standardtoolbar _framewk.vcx separatorClass..\ffc\_base.vcx_image..\ffc\_base.vcxDoapp *savepassword Confirms and stores new password for the user.  cmdPickWavcmdSave commandbutton _separator..\ffc\_base.vcx_commandbuttonClassFontBold = .T. FontName = "Courier New" FontSize = 9 Value = ("") Height = 24 Left = 118 SelectOnEntry = .T. TabIndex = 5 Top = 11 Width = 174 PasswordChar = "*" Name = "txtPassword" NTop = 3 Left = 136 Height = 24 Width = 3 Style = 1 Name = "_separator1" _optionstxtBelltextbox..\ffc\_base.vcxlabelClass..\ffc\_base.vcx_textbox commandbutton}PROCEDURE InteractiveChange THISFORM.cmdOK.Enabled = (ALLTRIM(THISFORM.txtPassword.Value) == ALLTRIM(THIS.Value)) ENDPROC _dialog_optionsopgHours_options_dialog_standardtoolbar..\ffc\_base.vcx_commandbutton _separator2 optiongroup _optiongroupPixels..\ffc\_base.vcx separatorbPROCEDURE Click IF NOT ISNULL(THIS.Parent.oApp) THIS.Parent.oApp.GoTop() ENDIF ENDPROC  _framewk.vcxyPROCEDURE Click IF VARTYPE(THIS.Parent.oApp) = "O" THIS.Parent.oApp.DoMenuItemInFrame("COPY") ENDIF ENDPROC _standardtoolbarJArial, 0, 9, 5, 15, 12, 13, 3, 0 MS Sans Serif, 0, 9, 5, 13, 11, 11, 2, 0  _aboutboxTop = 3 Left = 213 Height = 24 Width = 24 Picture = graphics\help.bmp Caption = "" ToolTipText = "Help" SpecialEffect = 2 ZOrderSet = 12 Name = "cmdHelp" ..\ffc\_base.vcx _separator_standardtoolbarSHeight = 80 Width = 390 DoCreate = .T. oapp = .NULL. Name = "_changepassword" opgBell_label _framewk.h.0,!Arial, 0, 9, 5, 15, 12, 13, 3, 0  _framewk.h optiongrouplabel_label..\ffc\_base.vcx_optionslabel _framewk.h _framewk.h.0, _reportpicker cmdRevert commandbutton..\ffc\_base.vcxcmdOpen _framewk.h_image _optiongrouplblHourscmdOK..\ffc\_base.vcx_commandbutton_optionsNTop = 3 Left = 105 Height = 35 Width = 5 Style = 1 Name = "_separator2" lblGlobalOptionsAutoSize = .F. FontName = "MS Sans Serif" Alignment = 2 Caption = "Credits" Height = 84 Left = 14 Top = 180 Width = 274 Name = "lblCredits" _standardtoolbar_labelxPROCEDURE Click IF VARTYPE(THIS.Parent.oApp) = "O" THIS.Parent.oApp.DoMenuItemInFrame("CUT") ENDIF ENDPROC  commandbuttonPROCEDURE InteractiveChange THISFORM.cmdOK.Enabled = (ALLTRIM(THISFORM.txtConfirmPassword.Value) == ALLTRIM(THIS.Value)) ENDPROC ..\ffc\_base.vcx_optionslblDocumentOptions commandbuttonAutoSize = .T. FontName = "MS Sans Serif" FontSize = 8 BackStyle = 0 Caption = "New Password:" Height = 15 Left = 12 Top = 15 Width = 76 TabIndex = 15 Name = "lblPassword" label_label..\ffc\_base.vcx..\ffc\_base.vcx_commandbutton_standardtoolbar_optionslabelPixels_documentpickerlblBell..\ffc\_base.vcxlPROCEDURE Click IF VARTYPE(THIS.Parent.oApp) = "O" THIS.Parent.oApp.DataRevert() ENDIF ENDPROC 3superclass for framework-supplied default about box _framewk.vcx_labellabel..\ffc\_base.vcxTop = 42 Left = 307 Height = 27 Width = 69 FontName = "MS Sans Serif" FontSize = 8 Cancel = .T. Caption = "\ 0 AND VARTYPE(tcCaption) = "C" THIS.cCaption = tcCaption ENDIF IF liPCount > 1 AND VARTYPE(tcVersion) = "C" THIS.cVersion = tcVersion ENDIF IF liPCount > 2 AND VARTYPE(tcAuthor) = "C" THIS.cAuthor = tcAuthor ENDIF IF liPCount > 3 AND VARTYPE(tcCompany) = "C" THIS.cCompany = tcCompany ENDIF IF liPCount > 4 AND VARTYPE(tcCopyright) = "C" THIS.cCopyright = tcCopyright ENDIF IF liPCount > 5 AND VARTYPE(tcTrademark) = "C" THIS.cTrademark = tcTrademark ENDIF IF liPcount > 6 AND VARTYPE(tcImage) = "C" THIS.cImage = tcImage ENDIF THIS.cImage = ALLTR(THIS.cImage) IF AT(".",THIS.cImage) = 0 THIS.cImage = THIS.cImage+".bmp" ENDIF THIS.cImage = FULLPATH(THIS.cImage) IF (FILE(THIS.cImage)) THIS.imgApplication.Visible = .T. THIS.imgApplication.Picture = THIS.cImage ELSE THIS.imgApplication.Visible = .F. ENDIF IF NOT EMPTY(THIS.cCaption) THIS.lblApplicationName.Caption = TRANS(THIS.cCaption) ENDIF. THIS.lblCredits.Caption = TRANS(THIS.cAuthor) THIS.lblCredits.Caption = THIS.lblCredits.Caption + ; CHR(13)+ ; TRANS(THIS.cCompany) THIS.lblCredits.Caption = THIS.lblCredits.Caption + ; CHR(13)+ ; TRANS(THIS.cCopyright) THIS.lblCredits.Caption = THIS.lblCredits.Caption + ; CHR(13)+ ; TRANS(THIS.cTrademark) THIS.lblCredits.Caption = THIS.lblCredits.Caption + ; CHR(13)+ ; TRANS(THIS.cVersion) THIS.Titlebar = 0 ELSE RETURN .F. ENDIF ENDPROC pPROCEDURE Destroy DODEFAULT() THIS.oApp = .NULL. ENDPROC PROCEDURE Refresh LOCAL llEnable IF NOT THIS.lDisabledForModal NODEFAULT DO CASE CASE TYPE("_SCREEN.ActiveForm.Parent") = "O" SET DATASESSION TO _SCREEN.ActiveForm.Parent.DataSessionID CASE TYPE("_SCREEN.ActiveForm") = "O" SET DATASESSION TO _SCREEN.ActiveForm.DataSessionID OTHERWISE * we're wherever we should be... ENDCASE llEnable = (RECCOUNT() > 1) IF llEnable * everything has been enabled WITH THIS.spnGo STORE 1 TO .SpinnerLowValue, .KeyBoardLowValue STORE RECCOUNT() TO ; .SpinnerHighValue, .KeyBoardHighValue .Value = RECNO() .Value = MIN(.Value,.SpinnerHighValue) && EOF() ENDWITH ELSE THIS.SetAll("Enabled", .F.) ENDIF ENDIF RETURN llEnable ENDPROC PROCEDURE filldocumentsarray LPARAMETERS tcMetaTableName DIME THIS.aDocuments[1,4] IF EMPTY(tcMetaTableName) RETURN .F. ENDIF LOCAL lcConditions IF THIS.lNew lcConditions = " AND DOC_NEW " ELSE lcConditions = " AND DOC_OPEN " ENDIF lcConditions = lcConditions + " AND NOT DELETED() " IF THIS.lSorted lcConditions = lcConditions + " ORDER BY 1 " ENDIF SELECT DOC_DESCR, DOC_EXEC, ; DOC_WRAP, ALT_EXEC ; FROM (tcMetaTableName) ; WHERE DOC_TYPE = PJX_META_DOC_REPORT_TYPE ; &lcConditions ; INTO ARRAY THIS.aDocuments RETURN ( _TALLY # 0) ENDPROC PROCEDURE execdocument LOCAL liRow liRow = THISFORM.lstDocuments.Value IF EMPTY(liRow) RETURN ENDIF DO CASE CASE NOT EMPTY(THIS.aDocuments[liRow,4]) && alt-exec LOCAL lcStatement lcStatement = ALLTR(THIS.aDocuments[liRow,4]) &lcStatement CASE THIS.aDocuments[liRow,3] && wrapped DO (ALLTRIM(THIS.aDocuments[liRow,2])) OTHERWISE && report THIS.oApp.DoReport(ALLTRIM(THIS.aDocuments[liRow,2]), ; ALLTRIM(THIS.aDocuments[liRow,1])) ENDCASE ENDPROC PROCEDURE Init LPARAMETERS toApp, tlAdd IF NOT DODEFAULT(toApp,tlAdd) RETURN .F. ENDIF * note: the editing capability isn't implemented yet. IF tlAdd THIS.Caption = REPORTPICKER_CAPTION_MODIFY_LOC ELSE THIS.Caption = REPORTPICKER_CAPTION_RUN_LOC ENDIF ENDPROC  PROCEDURE incrementfailedattempts THIS.iTries = THIS.iTries + 1 IF THIS.iTries >= THIS.iTriesAllowed MESSAGEBOX(LOGIN_TRIES_EXCEEDED_LOC,MB_ICONSTOP,THIS.Caption) THIS.FailLogIn() THIS.Release() ENDIF ENDPROC PROCEDURE addusernow LOCAL lcName THIS.lAddingUser = .F. IF THIS.OKToAdduser() IF (MESSAGEBOX(LOGIN_ADD_USER_LOC , ; MB_ICONEXCLAMATION+MB_YESNO, ; LOGIN_USER_NOT_FOUND_LOC) = IDYES) lcName = ALLTRIM(THIS.txtName.Value) INSERT INTO (THIS.oApp.cUserTableAlias) ; ((THIS.oApp.cUserTableIDField)) ; VALUES (lcName) THIS.lAddingUser = .T. MESSAGEBOX(LOGIN_NEW_USER_INFO_LOC,0,THIS.Caption) ENDIF ENDIF RETURN THIS.lAddingUser ENDPROC PROCEDURE oktoadduser * abstract in the base, would be done * according to any conditions you like. * certainly there has to be some way of adding * new users at startup, * if no currently-valid user exists. RETURN .T. ENDPROC PROCEDURE storenewpasswordinfo LPARAMETERS tcValueToStore ASSERT VARTYPE(tcValueToStore) = "C" THIS.oApp.StorePassword(tcValueToStore) ENDPROC PROCEDURE checkpasswordinfo LPARAMETERS tcValueToCheck RETURN (THIS.oApp.CheckPassword(tcValueToCheck)) ENDPROC PROCEDURE faillogin * this is the equivalent of a failed * SEEK in the table IF RECCOUNT(THIS.oApp.cUserTableAlias) > 0 GO BOTTOM IN (THIS.oApp.cUserTableAlias) SKIP IN (THIS.oApp.cUserTableAlias) ENDIF ENDPROC PROCEDURE QueryUnload IF THIS.ReleaseType = 1 && box hit IF THIS.lValidUser AND THIS.lValidPassword IF THIS.lAddingUser THIS.StoreNewPasswordInfo(ALLTR(THIS.txtPassword.Value)) ELSE IF NOT THIS.CheckPasswordInfo(ALLTR(THIS.txtPassword.Value)) WAIT WINDOW LEFT(LOGIN_WRONG_PASSWORD_LOC,254) TIMEOUT 2 THIS.txtPassword.SetFocus() NODEFAULT ENDIF ENDIF ELSE THIS.FailLogIn() ENDIF ENDIF ENDPROC PROCEDURE applyappattributes LPARAMETERS toApp LOCAL llSuccess llSuccess = DODEFAULT(toApp) IF llSuccess IF VARTYPE(toApp.cUserTableAlias) # "C" OR NOT USED(toApp.cUserTableAlias) llSuccess = .F. ELSE THIS.Caption = toApp.cCaption + " " + LOGIN_CAPTION_LOC IF NOT EMPTY(toApp.cCurrentUser) IF toApp.SeekCurrentUser() THIS.txtName.Value = toApp.cCurrentUser THIS.lValidUser = .T. ELSE THIS.lValidUser = .F. ENDIF ELSE THIS.lValidUser = .F. ENDIF THIS.lValidPassword = .F. THIS.oApp = toApp ENDIF ENDIF IF NOT llSuccess THIS.Release() ENDIF ENDPROC PROCEDURE Destroy THIS.oApp = .NULL. ENDPROC PROCEDURE KeyPress LPARAMETERS nKeyCode, nShiftAltCtrl IF nKeyCode = 27 THIS.FailLogIn() THIS.Release() ENDIF ENDPROC YPROCEDURE Init LPARAMETERS toApp, tlNew IF NOT DODEFAULT(toApp,tlNew) RETURN .F. ENDIF IF tlNew THIS.Caption = NEWOPEN_CAPTION_NEW_LOC ELSE THIS.Caption = NEWOPEN_CAPTION_OPEN_LOC ENDIF ENDPROC PROCEDURE execdocument LOCAL liRow liRow = THISFORM.lstDocuments.Value IF EMPTY(liRow) RETURN ENDIF DO CASE CASE NOT EMPTY(THIS.aDocuments[liRow,9]) && alt-exec LOCAL lcStatement lcStatement = ALLTR(THIS.aDocuments[liRow,9]) &lcStatement CASE THIS.aDocuments[liRow,8] && wrapped DO (ALLTRIM(THIS.aDocuments[liRow,2])) OTHERWISE && form or form class THIS.oApp.DoForm(ALLTRIM(THIS.aDocuments[liRow,2]), ; ALLTRIM(THIS.aDocuments[liRow,3]), ; THIS.aDocuments[liRow,4], ; THIS.aDocuments[liRow,5], ; THIS.aDocuments[liRow,6], ; THIS.aDocuments[liRow,7]) ENDCASE ENDPROC PROCEDURE filldocumentsarray LPARAMETERS tcMetaTableName DIME THIS.aDocuments[1,9] * array has 9 columns to match meta data info * First is visible description, plus 6 columns of DoForm params, * and then "wrapped" column meaning "this is a program not a class" * followed by "alt-exec" column, which gets macro-evaluated if used * LPARAMETERS tcFileName,tcClass,tlNoMultipleInstances,tlNoShow, tlGoMenu, tlNavToolbar * are the doform params... IF EMPTY(tcMetaTableName) RETURN .F. ENDIF LOCAL lcConditions IF THIS.lNew lcConditions = " AND DOC_NEW " ELSE lcConditions = " AND DOC_OPEN " ENDIF lcConditions = lcConditions + " AND NOT DELETED() " IF THIS.lSorted lcConditions = lcConditions + " ORDER BY 1 " ENDIF SELECT DOC_DESCR, DOC_EXEC, DOC_CLASS, ; DOC_SINGLE, DOC_NOSHOW, ; DOC_GO, DOC_NAV, ; DOC_WRAP, ALT_EXEC ; FROM (tcMetaTableName) ; WHERE DOC_TYPE = PJX_META_DOC_FORM_TYPE ; &lcConditions ; INTO ARRAY THIS.aDocuments RETURN ( _TALLY # 0) ENDPROC  ,PROCEDURE donologmessage LPARAMETERS tcMessage ?? CHR(7) MESSAGEBOX(tcMessage,MB_ICONINFORMATION,THIS.Caption) RETURN ENDPROC PROCEDURE ctextdisplayfont_assign LPARAMETERS tvNewVal IF VARTYPE(tvNewVal) = "C" THIS.cTextDisplayFont = tvNewVal STORE tvNewVal TO THIS.pgfErrorLog.Page1.edtListing.FontName, ; THIS.pgfErrorLog.Page2.edtUserNotes.FontName ENDIF ENDPROC PROCEDURE Resize WITH THIS.pgfErrorLog .Height = THIS.Height .Width = THIS.Width THIS.txtErrStamp.Left = (THIS.Width - THIS.txtErrStamp.Width)/2 THIS.spnNav.Left = THIS.txtErrStamp.Left+THIS.txtErrStamp.Width STORE .PageHeight - ; (THIS.pgfErrorLog.Page1.edtListing.Top+ ; THIS.iMargin) TO ; THIS.pgfErrorLog.Page1.edtListing.Height, ; THIS.pgfErrorLog.Page2.edtUserNotes.Height STORE THIS.Width - (THIS.iMargin*2) TO ; .Page1.edtListing.Width, ; .Page2.edtUserNotes.Width ENDWITH ENDPROC PROCEDURE Init IF DODEFAULT() THIS.MinHeight = THIS.Height THIS.MinWidth = THIS.Width THIS.iMargin = SYSMETRIC(12) STORE THIS.iMargin TO ; THIS.pgfErrorLog.Page1.edtListing.Left, ; THIS.pgfErrorLog.Page2.edtUserNotes.Left THIS.Resize() ELSE RETURN .F. ENDIF ENDPROC PROCEDURE Activate IF RECCOUNT(THIS.cAlias) < 2 THIS.spnNav.Enabled = .F. ELSE STORE RECCOUNT(THIS.cAlias) TO ; THIS.spnNav.SpinnerHighValue, THIS.spnNav.KeyboardHighValue STORE 1 TO THIS.spnNav.SpinnerLowValue, THIS.spnNav.KeyboardLowValue STORE RECNO(THIS.cAlias) TO THIS.spnNav.Value ENDIF THIS.Refresh() ENDPROC PROCEDURE applyappattributes LPARAMETERS toApp LOCAL lcTable IF DODEFAULT(toApp) lcTable = toApp.cErrorLogTableName IF EMPTY(lcTable) OR NOT FILE(lcTable) THIS.DoNoLogMessage(ERRORVIEWER_UNAVAILABLE_LOC ) RETURN .F. ENDIF USE (lcTable) SHARED ALIAS (THIS.cAlias) IN 0 IF NOT USED(THIS.cAlias) THIS.DoNoLogMessage(ERRORVIEWER_UNAVAILABLE_LOC ) RETURN .F. ENDIF IF EMPTY(RECCOUNT(THIS.cAlias)) THIS.DoNoLogMessage(ERRORVIEWER_EMPTY_LOC ) RETURN .F. ENDIF GO BOTTOM THIS.txtErrStamp.ControlSource=THIS.cAlias+".ErrStamp" THIS.pgfErrorLog.Page1.edtListing.ControlSource = THIS.cAlias+".Listing" THIS.pgfErrorLog.Page2.edtUserNotes.ControlSource = THIS.cAlias+".UserNotes" THIS.app_mediator.LoadApp(toApp.cReference) * the error log viewer is different from other * _dialog descendents in that it's not modal, * so it deserves a mediator for later use. ELSE RETURN .F. ENDIF ENDPROC PROCEDURE Destroy IF (NOT EMPTY(THIS.cAlias)) AND USED(THIS.cAlias) USE IN (THIS.cAlias) ENDIF ENDPROC  PROCEDURE setdialogsizeparameters LOCAL liMaxRows, lnListRowHeight, lnListMaxHeight, lnListMinHeight, lnMargin liMaxRows = ALEN(THIS.aDocuments,1) lnMargin = THIS.lstDocuments.Top WITH THIS.lstDocuments lnListRowHeight = FONTM(1,.FontName,.FontSize) + ; FONTM(5,.FontName,.FontSize) + ; FONTM(4,.FontName,.FontSize) lnListMaxHeight = MIN(lnListRowHeight * liMaxRows, ; (SYSMETRIC(2) - lnMargin * 2)) lnListMinHeight = lnListRowHeight * 2 IF NOT BETWEEN(.Height, lnListMinHeight, lnListMaxHeight) .Height = MIN(lnListMaxHeight, .Height) ENDIF ENDWITH THIS.MinWidth = THIS.Width THIS.MinHeight = MAX(lnListMinHeight + (lnMargin * 2), ; (THIS.cmdCancel.Top + THIS.cmdCancel.Height + lnMargin)) THIS.MaxHeight = MAX(THIS.MinHeight, lnListMaxHeight + (lnMargin * 2)) THIS.Height = MAX(THIS.MinHeight,THIS.lstDocuments.Height + (lnMargin * 2)) lnMargin = THIS.lstDocuments.Left THIS.Width = THIS.lstDocuments.Width+THIS.cmdCancel.Width+ lnMargin * 3 ENDPROC PROCEDURE Load DODEFAULT() SET DELETED ON ENDPROC PROCEDURE Init LPARAMETERS toApp, tlNew IF NOT DODEFAULT() RETURN .F. ENDIF LOCAL laTemp[1], llReturn ASSERT VARTYPE(tlNew) = "L" ASSERT TYPE("toApp.cMetaTable") = "C" AND ; ACLASS(laTemp,toApp) > 0 AND ; ASCAN(laTemp,"_APPLICATION") > 0 ; MESSAGE DOCUMENTPICKER_NO_APP_LOC THIS.lNew = tlNew THIS.oApp = toApp DO CASE CASE EMPTY(toApp.cMetaTable) OR ; (NOT THIS.FillDocumentsArray(toApp.GetResourceFileName(toApp.cMetaTable,".dbf"))) OR ; VARTYPE(THIS.aDocuments[1,1]) # "C" MESSAGEBOX(DOCUMENTPICKER_NO_DOCUMENTS_LOC, ; MB_ICONEXCLAMATION, ; toApp.cCaption) CASE ALEN(THIS.aDocuments,1) = 1 THIS.lstDocuments.RowSource = "THISFORM.aDocuments" THIS.lstDocuments.Value = 1 THIS.ExecDocument() OTHERWISE llReturn = .T. THIS.lstDocuments.RowSource = "THISFORM.aDocuments" ENDCASE IF NOT llReturn THIS.oApp = .NULL. ENDIF RETURN llReturn ENDPROC PROCEDURE Destroy DODEFAULT() THIS.oApp = .NULL. ENDPROC PROCEDURE KeyPress LPARAMETERS nKeyCode, nShiftAltCtrl DO CASE CASE nKeyCode = 27 THIS.cmdCancel.Click() NODEFAULT CASE nKeyCode = 23 THIS.cmdOK.Click() NODEFAULT OTHERWISE ENDCASE ENDPROC PROCEDURE Resize LOCAL lnMargin lnMargin = THIS.lstDocuments.Left STORE THIS.Width - (THIS.cmdCancel.Width + lnMargin ) TO ; THIS.cmdCancel.Left, ; THIS.cmdOK.Left STORE THIS.cmdCancel.Left - (lnMargin * 2) TO THIS.lstDocuments.Width lnMargin = THIS.lstDocuments.Top STORE THIS.Height - (lnMargin * 2) TO THIS.lstDocuments.Height ENDPROC PROCEDURE applyappattributes LPARAMETERS toapp IF DODEFAULT(toApp) THIS.SetDialogSizeParameters() THIS.Resize() ENDIF ENDPROC PROCEDURE displaycurrentuseroptions * show values from user options array in the dialog THIS.DisplayOptions("CURRENT") ENDPROC PROCEDURE saveuseroptionsfromdisplay THIS.SetFromDisplay("SAVE") ENDPROC PROCEDURE displayuserdefaultoptions * show values from default record in the dialog THIS.DisplayOptions("SAVED") ENDPROC PROCEDURE setuseroptionsfromdisplay THIS.SetFromDisplay("CURRENT") ENDPROC PROCEDURE setfromdisplay LPARAMETERS tcWhichSet IF VARTYPE(tcWhichSet) # "C" OR ; (NOT INLIST(tcWhichSet,"CURRENT","SAVE")) RETURN .F. ENDIF LOCAL llCurrent, lcArray, loForm, loMediator llCurrent = (tcWhichSet = "CURRENT") IF llCurrent lcArray = "THIS.oApp.aCurrentUserOpts" ELSE LOCAL ARRAY laOptions[1,4] lcArray = "laOptions" ENDIF DIME &lcArray.[6,4] * change depending on how many options you have... * and fill the array any way you want, just * so long as your usage matches * what you put in the array! &lcArray.[1,1] = "SHOWTIPS" &lcArray.[1,2] = THIS.chkShowTips.Value &lcArray.[1,3] = .F. && form or form member property &lcArray.[1,4] = .F. && private to datasessions/enabled forms, ; && and applied only on that level as requested && by form mediator object &lcArray.[2,1] = "CONFIRM" &lcArray.[2,2] = IIF(THIS.chkConfirm.Value,"ON","OFF") &lcArray.[2,3] = .T. && SET, not form or form member property &lcArray.[2,4] = .F. &lcArray.[3,1] = "HOURS" &lcArray.[3,2] = "TO "+THIS.opgHours.Buttons(THIS.opgHours.Value).Caption &lcArray.[3,3] = .T. && SET, not form or form member property &lcArray.[3,4] = .F. &lcArray.[4,1] = "cTextDisplayFont" &lcArray.[4,2] = IIF(EMPTY(THIS.cboTextDisplayFont.Value), ; THIS.oApp.cTextDisplayFont, ; THIS.cboTextDisplayFont.Value) &lcArray.[4,3] = .F. && application or application member property &lcArray.[4,4] = .T. && set on a global level, not form/session private &lcArray.[5,1] = "BELL" &lcArray.[5,2] = IIF(THIS.opgBell.Value = 1, "OFF","ON") &lcArray.[5,3] = .T. && SET, not app or app member property &lcArray.[5,4] = .T. &lcArray.[6,1] = "BELL TO" * I could have placed the word either in the first or * second part of the 'SET phrase', as you * can see from the SET HOURS entry, but in this case * putting it in the first one allows me to identify the * two SET BELL items uniquely later, when I use the * application.GetUserOptionSetting() method to find them. &lcArray.[6,2] = " " IF THIS.opgBell.Value = 3 AND (NOT EMPTY(ALLTRIM(THIS.txtBell.Value))) &lcArray.[6,2] = &lcArray.[6,2]+"["+ALLTR(THIS.txtBell.Value)+"],0" ENDIF &lcArray.[6,3] = .T. &lcArray.[6,4] = .T. IF llCurrent THIS.oApp.ApplyGlobalUserOptions() IF _SCREEN.FormCount > 0 * I am deliberately using * _SCREEN rather than THIS.oApp.aForms * here to account for collaborators or * a modal dialog under this one -- * anything that has a mediator, * not just anything in the aForms modeless * collection, should have properties applied. * It's faster, too, and I don't have to * distinguish between forms and formsets in * the _SCREEN collection FOR EACH loForm IN _SCREEN.Forms loMediator = THIS.oApp.GetFormMediatorRef(loForm) IF VARTYPE(loMediator) = "O" loMediator.DoSessionSets() loForm.Refresh() ENDIF ENDFOR ENDIF ELSE REPLACE (THIS.oApp.cUserTableAlias+".UserOpts") WITH "" && this may avoid some bloat SAVE ALL LIKE laOptions TO MEMO (THIS.oApp.cUserTableAlias+".UserOpts") THIS.cmdResetToDefault.Enabled = .T. ENDIF ENDPROC PROCEDURE displayoptions LPARAMETERS tcWhichSet IF VARTYPE(tcWhichSet) # "C" OR ; (NOT INLIST(tcWhichSet,"CURRENT","SAVED")) RETURN .F. ENDIF LOCAL llCurrent, lvValue llCurrent = (tcWhichSet = "CURRENT") IF NOT llCurrent RESTORE FROM MEMO (THIS.oApp.cUserTableAlias+".UserOpts") ADDITIVE * local array laOptions now exists ENDIF IF llCurrent lvValue = THIS.oApp.GetUserOptionSetting("BELL") ELSE lvValue = THIS.oApp.GetUserOptionSetting("BELL", @laOptions) ENDIF IF VARTYPE(lvValue) # "C" lvValue = SET("BELL") ENDIF IF lvValue = "OFF" THIS.opgBell.Value = 1 ELSE THIS.opgBell.Value = 2 ENDIF IF llCurrent lvValue = THIS.oApp.GetUserOptionSetting("BELL TO") ELSE lvValue = THIS.oApp.GetUserOptionSetting("BELL TO", @laOptions) ENDIF IF VARTYPE(lvValue) = "C" lvValue = STRTRAN(UPPER(lvValue),",0","") lvValue = STRTRAN(lvValue,"[","") lvValue = ALLTRIM(STRTRAN(lvValue,"]","")) IF (NOT EMPTY(lvValue)) AND FILE(lvValue) THIS.opgBell.Value = 3 THIS.txtBell.Value = lvValue ELSE THIS.txtBell.Value = SET("BELL",1) ENDIF ELSE THIS.txtBell.Value = SET("BELL",1) ENDIF IF llCurrent lvValue = THIS.oApp.GetUserOptionSetting("CONFIRM") ELSE lvValue = THIS.oApp.GetUserOptionSetting("CONFIRM", @laOptions) ENDIF IF VARTYPE(lvValue) # "C" THIS.chkConfirm.Value = (SET("CONFIRM") = "ON") ELSE THIS.chkConfirm.Value = (lvValue = "ON") ENDIF IF llCurrent lvValue = THIS.oApp.GetUserOptionSetting("SHOWTIPS") ELSE lvValue = THIS.oApp.GetUserOptionSetting("SHOWTIPS", @laOptions) ENDIF IF VARTYPE(lvValue) # "L" THIS.chkShowTips.Value = THIS.ShowTips ELSE THIS.chkShowTips.Value = lvValue ENDIF IF llCurrent lvValue = THIS.oApp.GetUserOptionSetting("cTextDisplayFont") ELSE lvValue = THIS.oApp.GetUserOptionSetting("cTextDisplayFont", @laOptions) ENDIF IF VARTYPE(lvValue) # "C" THIS.cboTextDisplayFont.Value = THIS.oApp.cTextDisplayFont ELSE THIS.cboTextDisplayFont.Value = lvValue ENDIF IF llCurrent lvValue = THIS.oApp.GetUserOptionSetting("HOURS") ELSE lvValue = THIS.oApp.GetUserOptionSetting("HOURS", @laOptions) ENDIF IF VARTYPE(lvValue) # "C" lvValue = TRANSFORM(SET("HOURS")) ENDIF IF THIS.opgHours.Buttons(1).Caption $ lvValue THIS.opgHours.Value = 1 ELSE THIS.opgHours.Value = 2 ENDIF ENDPROC PROCEDURE KeyPress LPARAMETERS nKeyCode, nShiftAltCtrl IF nKeyCode = 27 THIS.Release() ENDIF ENDPROC PROCEDURE Destroy DODEFAULT() THIS.oApp = .NULL. ENDPROC PROCEDURE applyappattributes LPARAMETERS toApp LOCAL llSuccess llSuccess = DODEFAULT(toApp) IF llSuccess IF USED(toApp.cUserTableAlias) THIS.Caption = toApp.cCaption + " " + OPTIONS_LOC THIS.oApp = toApp THIS.DisplayCurrentUserOptions() IF EMPTY(EVAL(toApp.cUserTableAlias+".UserOpts")) WAIT WINDOW NOWAIT LEFT(OPTIONS_NOT_STORED_LOC,254) THIS.cmdResetToDefault.Enabled = .F. ENDIF ELSE llSuccess = .F. ENDIF ENDIF IF NOT (llSuccess AND THIS.oApp.IsErrorFree()) THIS.Release() ENDIF ENDPROC ichangemode Sent on to the app's cusDataSession object to detemine what constitutes data change. 0 - anything changed. 1 - ignore view fields not in Updatefields list. 2- ignore views not set to send updates. cappref Holds the name of the reference variable for the running app so the mediator can evaluate it to an object reference when necessary. The mediator does not store any object references, for safety. lusersessionsettings Specifies whether the mediator should load data-session-specific user settings using the application's defaults. coutputalias Allows you to indicate the right alias to "focus on" when the app DoTableOutput method runs, without any additional work in PrepareOutputAlias() and CleanupOutputAlias(). coutputcaption Will be passed by the app's DoTableOutput() to the _outputdialog, if used. osession If .T. is passed to the _mediator class when it's instanced, holds the session object for this mediator. Otherwise the mediator looks for its parent form's session. datasession Wraps the Datasession property of the session object, if this mediator created one datasessionid Wraps the DatasessionID property of the session object, if this mediator created one lsessionsettings Specifies whether the mediator should load session settings using the application's defaults. lsetdocumenttonewonappload If .T., specifies that mediator should invoke SetDocumentToNew() in LoadApp. ladding Stores information about whether the framework invoked a session for "new" or "open" editing. csessionclass The programmatic class definition to instance if .T. is passed to the class. By default, an instance of the session baseclass is created. csessionclasslib The programmatic classlibrary holding the cSessionClass class definition you wish to instantiate. By default, an instance of the session baseclass is created. datasessionname Wraps the Name property of the session object, if this mediator created one *datasession_access *datasessionid_access *datasessionid_assign *queryunload Invokes the app's QueryDataSessionUnload for this Session. If used with a form, should be called in the form's QueryUnload() to handle any data changes, updates, or reverts before the form is closed. *datachanged Wraps application QueryDataChanged method, using iChangeMode specific to this object. *pickrecordtoworkon Abstract, available to evaluate whether form has been invoked in "new" or "open" mode, and for you to add record browsing/navigation/APPEND BLANK/whatever based on this information. *setdocumenttonew Stores the app's lAddingNewDocument flag at the time the app attributes are loaded, so the form can evaluate what record to work on. *dosessionsets If lSessionSettings is .T., invokes app SetDataSessionEnvironment() method for this session If lUserSessionSettings is .T., invokes app ApplyUserOptsForSession() method for this session. *loadapp Applies app attributes, including session settings. Sets new or open status if lSetDocumentToNewOnAppLoad is .T.. *getappref RETURNs an object reference to the app. *coutputalias_assign *prepareoutputalias Abstract, will be invoked by app's DoTableOutput() so you can SELECT a focus table, or put together a cursor, filter data, or otherwise prepare appropriate "focussed" table information when the user chooses to get quick output from any form. *coutputcaption_access *cleanupoutputalias Abstract, see PrepareOutputAlias(). If you have created a temporary cursor for the purposes of DoTableOutput(), here's your chance to destroy it. *outputonerecord Wraps the app DoTableOutput() method with a scope of one record. *output Wraps the app DoTableOutput() method. *createsession Creates the session object if .T. passed to the class upon instantiation *writesessionclassdefinition Not currently used; designed to provide a model for generation of a class definition file if desired. Would be called by the cSessionClassLib access method. *csessionclasslib_access *csessionclass_access *datasessionname_access *datasession_assign *datasessionname_assign itoolbarindex Provided to the mediator by the app when it invokes a context toolbar for the mediator's host document, passed back to the app by the mediator so the app can refresh its context toolbar collection when this host document destroys. icontextmenuindex Provided to the mediator by the app when it invokes a context menu for the mediator's host document, passed back to the app by the mediator so the app can refresh its context menu collection when this host document destroys. ctoolbarclass Holds the name of a context toolbar class you wish to attach to this mediator's host document. ctoolbarclasslib Holds the name of a class library containing the context toolbar class you wish to attach to this mediator's host document. ccontextmenufile Holds the name of a context menu you wish to attach to this mediator's host document. ccontextmenupopup Holds the pad name of the context menu popup so it can be released when the host document destroys. ccontextmenupad Holds the pad name of the context menu so it can be removed when the host document destroys. lnavtoolbar Specifies whether or not the host document has been assigned a navigation toolbar by the application and its metatable entry. lgomenu Specifies whether or not the host document has been assigned a navigation menu by the application and its metatable entry. laddappicon Specifies that the mediator should apply the application's standard Icon to the form's Icon property, if this property has been left empty. Defaults to .T.; turn it off if you want a borderless form! PROCEDURE datasession_access IF ISNULL(THIS.oSession) IF TYPE("THISFORMSET.BaseClass") = "C" RETURN THISFORMSET.DataSession ELSE RETURN THISFORM.DataSession ENDIF ELSE RETURN THIS.oSession.DataSession ENDIF ENDPROC PROCEDURE datasessionid_access IF ISNULL(THIS.oSession) RETURN SET("DATASESSION") ELSE RETURN THIS.oSession.DataSessionID ENDIF ENDPROC PROCEDURE datasessionid_assign LPARAMETERS tvNewVal * don't allow assignment ENDPROC PROCEDURE queryunload LPARAMETERS tlDataChangeAlreadyConfirmed LOCAL loApp, llReturn, loSession loApp = THIS.GetAppRef() IF ISNULL(loApp) RETURN ENDIF IF ISNULL(THIS.oSession) IF TYPE("THISFORM") # "O" RETURN ELSE loSession = THISFORM ENDIF ELSE loSession = THIS.oSession ENDIF llReturn = NOT ISNULL(loSession) IF llReturn llReturn = loApp.QueryDataSessionUnload(tlDataChangeAlreadyConfirmed,loSession) ENDIF STORE .NULL. TO loApp, loSession RETURN llReturn ENDPROC PROCEDURE datachanged LOCAL loApp, llReturn, loSession loApp = THIS.GetAppRef() IF ISNULL(loApp) RETURN ENDIF IF ISNULL(THIS.oSession) IF TYPE("THISFORM") # "O" RETURN ELSE loSession = THISFORM ENDIF ELSE loSession = THIS.oSession ENDIF llReturn = NOT ISNULL(loSession) IF llReturn llReturn = loApp.QueryDataChanged(loSession,THIS.iChangeMode) ENDIF STORE .NULL. TO loApp, loSession RETURN llReturn ENDPROC PROCEDURE setdocumenttonew LPARAMETERS toApp LOCAL loApp loApp = NULL IF VARTYPE(toApp) = "O" * called from LoadApp * or something else that knows * the app already loApp = toApp ELSE loApp = THIS.GetAppRef() ENDIF IF ISNULL(loApp) RETURN ENDIF THIS.lAdding = loApp.lAddingNewDocument loApp = .NULL. ENDPROC PROCEDURE dosessionsets LPARAMETERS toApp LOCAL loApp loApp = NULL IF VARTYPE(toApp) = "O" * called from LoadApp * or something else that knows * the app already loApp = toApp ELSE loApp = THIS.GetAppRef() ENDIF IF ISNULL(loApp) RETURN ENDIF IF THIS.lSessionSettings DO CASE CASE NOT ISNULL(THIS.oSession) loApp.SetDataSessionEnvironment(THIS.oSession.DataSessionID) CASE TYPE("THISFORMSET.DataSession") = "N" AND ; THISFORMSET.DataSession # 1 loApp.SetDataSessionEnvironment(THISFORMSET.DataSessionID) CASE THISFORM.DataSession # 1 loApp.SetDataSessionEnvironment(THISFORM.DataSessionID) OTHERWISE * a form or formset in the default session, don't touch ENDCASE ENDIF IF THIS.lUserSessionSettings IF NOT ISNULL(THIS.oSession) loApp.ApplyUserOptsForSession(THIS.oSession) ELSE loApp.ApplyUserOptsForSession(THISFORM) ENDIF ENDIF loApp = NULL ENDPROC PROCEDURE loadapp LPARAMETERS tcAppRef THIS.cAppRef = tcAppRef LOCAL loApp loApp = THIS.GetAppRef() IF ISNULL(loApp) RETURN .F. ENDIF THIS.DoSessionSets(loApp) IF THIS.lSetDocumentToNewOnAppLoad THIS.SetDocumentToNew(loApp) ENDIF loApp = .NULL. ENDPROC PROCEDURE getappref IF EMPTY(THIS.cAppRef) RETURN .NULL. ENDIF LOCAL ARRAY laCheck[1] IF TYPE(THIS.cAppRef+".BaseClass") = "C" ; AND ACLASS(laCheck,EVAL(THIS.cAppRef)) > 0 AND ; ASCAN(laCheck,"_APPLICATION") > 0 RETURN EVAL(THIS.cAppRef) ELSE RETURN .NULL. ENDIF ENDPROC PROCEDURE coutputalias_assign LPARAMETERS tvNewVal IF VARTYPE(tvNewVal) = "C" AND USED(tvNewVal) THIS.cOutputAlias = tvNewVal ENDIF ENDPROC PROCEDURE coutputcaption_access IF EMPTY(THIS.cOutputCaption) AND (NOT EMPTY(THIS.cOutputAlias)) RETURN PROPER(THIS.cOutputAlias) ELSE RETURN THIS.cOutputCaption ENDIF ENDPROC PROCEDURE outputonerecord LOCAL loApp, llReturn loApp = THIS.GetAppRef() IF ISNULL(loApp) RETURN ENDIF llReturn = loApp.DoTableOutput(.T.) loApp = .NULL. RETURN llReturn ENDPROC PROCEDURE output LOCAL loApp, llReturn loApp = THIS.GetAppRef() IF ISNULL(loApp) RETURN ENDIF llReturn = loApp.DoTableOutput() loApp = .NULL. RETURN llReturn ENDPROC PROCEDURE createsession lcClass = THIS.cSessionClass lcClassLib = THIS.cSessionClassLib IF EMPTY(lcClassLib) RETURN CREATEOBJECT("Session") ELSE RETURN NEWOBJECT(lcClass, lcClassLib) ENDIF ENDPROC PROCEDURE writesessionclassdefinition LPARAMETERS tcFileName * not currently used, * for generation purposes LOCAL lcFileName, llSafety IF EMPTY(tcFileName) RETURN ELSE lcFileName = tcFileName ENDIF llSafety = (SET("SAFETY") == "ON") IF llSafety SET SAFETY OFF ENDIF lcFileName = FORCEEXT(lcFileName,"PRG") STRTOFILE("DEFINE CLASS "+THIS.cSessionClass+" AS Session"+CHR(13)+CHR(10),lcFileName) STRTOFILE("DataSession = 2"+CHR(13)+CHR(10),lcFileName,.T.) STRTOFILE("ENDDEFINE"+CHR(13)+CHR(10),lcFileName,.T.) COMPILE (lcFileName) ERASE (lcFileName) THIS.cSessionClassLib = FORCEEXT(lcFileName,"FXP") IF llSafety SET SAFETY ON ENDIF ENDPROC PROCEDURE csessionclasslib_access LOCAL lcVal IF VARTYPE(THIS.cSessionClassLib) # "C" OR EMPTY(THIS.cSessionClassLib) *!* * to generate: *!* lcVal = ADDBS(GETENV("TEMP"))+"C"+SYS(2015)+".PRG" lcVal = "" ELSE lcVal = FORCEEXT(THIS.cSessionClassLib,"FXP") IF NOT FILE(lcVal) && either on disk or bound *!* * to generate: *!* IF NOT DIRECTORY(JUSTPATH(lcVal)) *!* lcVal = FORCEPATH(lcVal,ADDBS(GETENV("TEMP"))) *!* ENDIF *!* lcVal = FORCEEXT(lcVal,"PRG") *!* IF EMPTY(SYS(2000,lcVal)) *!* THIS.WriteSessionClassDefinition(lcVal) *!* ENDIF *!* lcVal = FORCEEXT(lcVal,"FXP") lcVal = FORCEEXT(lcVal,"PRG") IF EMPTY(SYS(2000,lcVal)) && on disk lcVal = "" ELSE COMPILE (lcVal) lcVal = FORCEEXT(lcVal,"FXP") ENDIF ENDIF ENDIF THIS.cSessionClassLib = lcVal RETURN THIS.cSessionClassLib ENDPROC PROCEDURE csessionclass_access IF VARTYPE(THIS.cSessionClass) # "C" ; OR EMPTY(THIS.cSessionClass) ; OR VARTYPE(THIS.cSessionClassLib) # "C" ; OR EMPTY(THIS.cSessionClassLib) * THIS.cSessionClass = "Session"+SYS(2015) THIS.cSessionClass = "Session" ENDIF RETURN THIS.cSessionClass ENDPROC PROCEDURE datasessionname_access IF ISNULL(THIS.oSession) RETURN "" ELSE RETURN THIS.oSession.Name ENDIF ENDPROC PROCEDURE datasession_assign LPARAMETERS vNewVal * don't allow assignment ENDPROC PROCEDURE datasessionname_assign LPARAMETERS vNewVal * readonly, don't allow assignment ENDPROC PROCEDURE Init LPARAMETERS tlCreateSession, tcSessionClass, tcSessionClassLib IF DODEFAULT() IF tlCreateSession IF NOT (EMPTY(tcSessionClass) OR EMPTY(tcSessionClassLib)) THIS.cSessionClass = tcSessionClass THIS.cSessionClassLib = tcSessionClassLib ENDIF THIS.oSession = THIS.CreateSession() IF VARTYPE(THIS.oSession) # "O" RETURN .F. ENDIF ELSE IF TYPE("THISFORM") # "O" RETURN .F. ENDIF ENDIF ELSE RETURN .F. ENDIF ENDPROC PROCEDURE Destroy DODEFAULT() THIS.oSession = NULL ENDPROC 4$PROCEDURE refreshfavoriteids LPARAMETERS tcFavoriteIDToAdd ASSERT THIS.lNew LOCAL lcCurrentIDs, lcID, liID IF VARTYPE(tcFavoriteIDToAdd) = "C" AND ; NOT EMPTY(tcFavoriteIDToAdd) lcID = ALLTRIM(tcFavoriteIDToAdd) lcCurrentIDs = ALLTRIM(THIS.oApp.cCurrentUserFavoriteIDs) IF INLIST(RIGHT(lcCurrentIDs,1), ; CHR(13), CHR(10)) THIS.oApp.cCurrentUserFavoriteIDs = ; lcCurrentIDs + lcID ELSE THIS.oApp.cCurrentUserFavoriteIDs = ; lcCurrentIDs +CHR(13)+lcID ENDIF ELSE * removing or otherwise doing a general refresh lcCurrentIDs = "" FOR liID = 1 TO ALEN(THIS.aDocuments,1) IF LEFT(THIS.aDocuments[liID,1],FAVORITEPICKER_PICKED_LEN) = FAVORITEPICKER_PICKED_LOC lcCurrentIDs = lcCurrentIDs + CHR(13) IF EMPTY(THIS.aDocuments[liID,11]) lcCurrentIDs = lcCurrentIDs + SUBSTR(THIS.aDocuments[liID,1],FAVORITEPICKER_PICKED_LEN+1) ELSE lcCurrentIDs = lcCurrentIDs + THIS.aDocuments[liID,11] ENDIF ENDIF ENDFOR THIS.oApp.cCurrentUserFavoriteIDs = lcCurrentIDs ENDIF ENDPROC PROCEDURE refreshbuttons IF THIS.lNew IF THIS.lstDocuments.Value = 0 OR ; EMPTY(THIS.aDocuments[THIS.lstDocuments.Value,1]) STORE .F. TO THIS.cmdOK.Enabled, THIS.cmdRemove.Enabled ELSE STORE (LEFT(THIS.aDocuments[THIS.lstDocuments.Value,1], ; FAVORITEPICKER_PICKED_LEN ) # ; FAVORITEPICKER_PICKED_LOC ) TO ; THIS.cmdOK.Enabled STORE ! THIS.cmdOK.Enabled TO ; THIS.cmdRemove.Enabled ENDIF ENDIF ENDPROC PROCEDURE removedocument ASSERT THIS.lNew LOCAL liRow, liCount liRow = THIS.lstDocuments.Value liCount = ALEN(THIS.aDocuments,1) IF (NOT BETWEEN(liRow,1,liCount)) OR ; (LEFT(THIS.aDocuments[liRow,1], ; FAVORITEPICKER_PICKED_LEN) # ; FAVORITEPICKER_PICKED_LOC ) * shouldn't happen RETURN ENDIF DO CASE CASE EMPTY(THIS.aDocuments[liRow,1]) * empty first row, nothing to do RETURN CASE EMPTY(THIS.aDocuments[liRow,11]) * document on disk, remove from listbox ADEL(THIS.aDocuments,liRow) IF liCount > 1 liCount = liCount - 1 DIME THIS.aDocuments[liCount,11] ELSE THIS.aDocuments[1,1] = "" ENDIF OTHERWISE * metatable entry, un-mark in listbox THIS.aDocuments[liRow,1] = SUBSTR(THIS.aDocuments[liRow,1],; FAVORITEPICKER_PICKED_LEN+1) ENDCASE THIS.lstDocuments.Requery() IF liRow > liCount THIS.lstDocuments.Value = liCount ELSE THIS.lstDocuments.Value = liRow ENDIF THIS.RefreshFavoriteIDs() ENDPROC PROCEDURE Resize DODEFAULT() LOCAL lnMargin lnMargin = THIS.Height - (THIS.lstDocuments.Top+THIS.lstDocuments.Height) THIS.cmdBrowse.Top = THIS.Height - (THIS.cmdBrowse.Height + lnMargin) STORE THIS.cmdCancel.Left TO THIS.cmdBrowse.Left, THIS.cmdRemove.Left ENDPROC PROCEDURE filldocumentsarray LPARAMETERS tcMetaTableName DIME THIS.aDocuments[1,11] LOCAL liTally, liDocument, lcConditions, laFavorites[1], ; liFaves, lcDocument, llExactSet, lcTable, liDocs llExactSet = (SET("EXACT") = "OFF") IF llExactSet SET EXACT ON ENDIF liTally = 0 liDocs = 0 IF NOT EMPTY(tcMetaTableName) lcTable = THIS.oApp.GetResourceFileName(tcMetaTableName,".dbf") IF NOT EMPTY(lcTable) lcConditions = " DOC_OPEN AND NOT DELETED() " SELECT DOC_DESCR, DOC_EXEC, DOC_CLASS, ; DOC_SINGLE, DOC_NOSHOW, ; DOC_GO, DOC_NAV, ; DOC_WRAP, ALT_EXEC, DOC_TYPE, APP_META_FAVE_ID AS DOC_ID ; FROM (lcTable) ; WHERE &lcConditions ; INTO ARRAY THIS.aDocuments * this is for a startup form, and picking favorites, using * all metatable's document items, both reports and forms, * so array fits both types of documents' usage * above is form's use of metatable fields + one (doc_type) + ID field or expression * below is report's use of fields (favorites/startup has to use both) * report's use of fields: * SELECT DOC_DESCR, DOC_EXEC, ; * DOC_WRAP, ALT_EXEC ; * FROM (tcMetaTableName) ; * WHERE DOC_TYPE = PJX_META_DOC_REPORT_TYPE ; * &lcConditions ; * AND NOT DELETED() ; * INTO ARRAY THIS.aDocuments STORE _TALLY TO liTally, liDocs ENDIF ENDIF liFaves = ALINES(laFavorites,THIS.oApp.cCurrentUserFavoriteIDs,.T.) IF (liTally # 0) FOR liDocument = 1 TO liTally THIS.aDocuments[liDocument,11] = ALLTR(THIS.aDocuments[liDocument,11]) IF ASCAN(laFavorites,; THIS.aDocuments[liDocument,11]) > 0 IF THIS.lNew THIS.aDocuments[liDocument,1] = ; FAVORITEPICKER_PICKED_LOC + ; THIS.aDocuments[liDocument,1] liTally = liTally - 1 * show as disabled items already * in the user table as favorites ENDIF ENDIF ENDFOR ENDIF IF (liFaves # 0) * if a favorite is a document on disk, * rather than something from the metatable, * add it to the list, * disabled if we are in New, * enabled otherwise FOR EACH lcDocument IN laFavorites IF NOT EMPTY(lcDocument) AND ; ASCAN(THIS.aDocuments,lcDocument) = 0 AND ; FILE(lcDocument) liTally = liTally + 1 liDocs = liDocs + 1 DIME THIS.aDocuments[liDocs,11] THIS.aDocuments[liDocs,1] = ALLTR(UPPER(lcDocument)) IF THIS.lNew THIS.aDocuments[liDocs,1] = FAVORITEPICKER_PICKED_LOC + THIS.aDocuments[liDocs,1] ENDIF ENDIF ENDFOR ENDIF If llExactSet SET EXACT OFF ENDIF IF THIS.lSorted ASORT(THIS.aDocuments) ENDIF IF liDocs = 0 AND (THIS.lNew AND THIS.lAllowFileBrowsing) * make sure list doesn't look stupid THIS.aDocuments[1,1]="" ENDIF RETURN (liTally # 0) OR ; (THIS.lNew AND (THIS.lAllowFileBrowsing OR liDocs # 0)) ENDPROC PROCEDURE execdocument LPARAMETERS tcFile * if a filename has been sent here, * we're browsing/picking directly * otherwise, we're working off the documents array LOCAL liRow, lcExt, lcFile, lcStatement, ; laFavorites[1], ; llDocumentFromDisk, llExactSet liRow = THIS.lstDocuments.Value IF VARTYPE(tcFile) # "C" AND ; (EMPTY(THIS.aDocuments[liRow,1]) OR ; NOT BETWEEN(liRow,1,ALEN(THIS.aDocuments,1))) RETURN ENDIF IF VARTYPE(tcFile) = "C" lcFile = UPPER(ALLTRIM(tcFile)) lcExt = JUSTEXT(lcFile) IF INLIST(lcExt,"SCT","LBT","FRT") lcFile = LEFT(lcFile,LEN(lcFile)-1)+"X" lcExt = LEFT(lcExt,LEN(lcExt)-1)+"X" ENDIF IF NOT FILE(lcFile) THIS.oApp.FileNotFoundMsgBox(lcFile) RETURN ENDIF llDocumentFromDisk = .T. ELSE IF LEFT(THIS.aDocuments[liRow,1],FAVORITEPICKER_PICKED_LEN ) = ; FAVORITEPICKER_PICKED_LOC * we're removing a document * we've been called from * doubleclick on list or something, * so let's toggle: THIS.RemoveDocument() RETURN ENDIF IF THIS.lNew lcFile = THIS.aDocuments[liRow,11] THIS.aDocuments[liRow,1] = ; FAVORITEPICKER_PICKED_LOC +THIS.aDocuments[liRow,1] ELSE * is this a document from disk instead * of a metatable entry? * documents from disk use only * the first column of the array IF EMPTY(THIS.aDocuments[liRow,11]) lcFile = THIS.aDocuments[liRow,1] llDocumentFromDisk = .T. lcExt = JUSTEXT(lcFile) ENDIF ENDIF ENDIF IF THIS.lNew * we have a document to add to the * list. Is it from the metatable or disk? * and is it already there? IF (NOT EMPTY(lcFile)) ALINES(laFavorites,THIS.oApp.cCurrentUserFavoriteIDs,.T.) llExactSet = (SET("EXACT") = "OFF") IF llExactSet SET EXACT ON ENDIF IF (ASCAN(laFavorites,lcFile) = 0) IF llDocumentFromDisk liRow = ALEN(THIS.aDocuments,1) IF VARTYPE(THIS.aDocuments[liRow,1]) = "C" AND ; (NOT EMPTY(THIS.aDocuments[liRow,1])) liRow = liRow + 1 DIME THIS.aDocuments[liRow,11] ENDIF THIS.aDocuments[liRow,1] = FAVORITEPICKER_PICKED_LOC +lcFile ENDIF THIS.lstDocuments.Requery() THIS.lstDocuments.Value = liRow THIS.RefreshFavoriteIDs(lcFile) ELSE MESSAGEBOX(lcFile+; CHR(13)+CHR(13)+ ; FAVORITEPICKER_DOC_ALREADY_LOC, ; 48,THISFORM.oApp.cCaption) ENDIF IF llExactSet SET EXACT OFF ENDIF ENDIF ELSE IF llDocumentFromDisk THIS.oApp.DoFile(lcFile) ELSE DO CASE CASE NOT EMPTY(THIS.aDocuments[liRow,9]) && alt-exec lcStatement = ALLTR(THIS.aDocuments[liRow,9]) &lcStatement CASE THIS.aDocuments[liRow,8] && wrapped DO (ALLTRIM(THIS.aDocuments[liRow,2])) OTHERWISE && report or form?? IF ALLTR(THIS.aDocuments[liRow,10]) = PJX_META_DOC_REPORT_TYPE THIS.oApp.DoReport(ALLTRIM(THIS.aDocuments[liRow,2]), ; ALLTRIM(THIS.aDocuments[liRow,1])) ELSE THIS.oApp.DoForm(ALLTRIM(THIS.aDocuments[liRow,2]), ; ALLTRIM(THIS.aDocuments[liRow,3]), ; THIS.aDocuments[liRow,4], ; THIS.aDocuments[liRow,5], ; THIS.aDocuments[liRow,6], ; THIS.aDocuments[liRow,7]) ENDIF ENDCASE ENDIF ENDIF ENDPROC PROCEDURE Init LPARAMETERS toApp, tlAdd LOCAL laTemp[1], llReturn THIS.lNew = tlAdd THIS.oApp = toApp ASSERT TYPE("toApp.cMetaTable") = "C" AND ; ACLASS(laTemp,toApp) > 0 AND ; ASCAN(laTemp,"_APPLICATION") > 0 ; MESSAGE DOCUMENTPICKER_NO_APP_LOC * override of some document picker stuff... * favorites can work without a * registered document table or a list at all... DO CASE CASE NOT THIS.FillDocumentsArray(toApp.cMetaTable) IF THIS.lAllowFileBrowsing LOCAL lcFile, lcWaitMessage THIS.lNew = tlAdd IF tlAdd lcWaitMessage = FAVORITEPICKER_CAPTION_ADD_LOC ELSE lcWaitMessage = FAVORITEPICKER_CAPTION_START_LOC ENDIF WAIT WINDOW NOWAIT ; LEFT(lcWaitMessage, 250)+"..." lcFile = GETFILE() WAIT CLEAR IF (NOT EMPTY(lcFile)) AND FILE(lcFile) THIS.ExecDocument(lcFile) ENDIF ELSE MESSAGEBOX(DOCUMENTPICKER_NO_DOCUMENTS_LOC, ; MB_ICONEXCLAMATION, ; toApp.cCaption) ENDIF THIS.oApp = .NULL. RETURN .F. CASE ALEN(THIS.aDocuments,1) = 1 AND ; NOT (tlAdd OR THIS.lAllowFileBrowsing) THIS.lstDocuments.RowSource = "THISFORM.aDocuments" THIS.lstDocuments.Value = 1 THIS.ExecDocument() THIS.oApp = .NULL. RETURN .F. OTHERWISE THIS.lstDocuments.RowSource = "THISFORM.aDocuments" THIS.lstDocuments.Value = 1 IF tlAdd THIS.Caption = FAVORITEPICKER_CAPTION_ADD_LOC THIS.cmdOK.Caption = FAVORITEPICKER_ADDBUTTON_LOC THIS.cmdCancel.Caption = FAVORITEPICKER_CLOSEBUTTON_LOC THIS.cmdOK.Default = .F. ELSE THIS.Caption = FAVORITEPICKER_CAPTION_START_LOC THIS.cmdCancel.Top = THIS.cmdRemove.Top STORE .F. TO THIS.cmdRemove.Visible, ; THIS.cmdRemove.Enabled ENDIF IF NOT THIS.lAllowFileBrowsing STORE .F. TO THIS.cmdBrowse.Visible, ; THIS.cmdBrowse.Enabled ENDIF ENDCASE ENDPROC PROCEDURE setdialogsizeparameters DODEFAULT() THIS.MinHeight = MAX(THIS.MinHeight, ; THIS.cmdCancel.Top + THIS.cmdCancel.Height + ; THIS.cmdBrowse.Height + ; THIS.lstDocuments.Top * 2) THIS.Height = MAX(THIS.Height, THIS.MinHeight) THIS.MaxHeight = MAX(THIS.Height, THIS.MaxHeight) ENDPROC PROCEDURE lstDocuments.When THIS.InteractiveChange() ENDPROC PROCEDURE lstDocuments.InteractiveChange THISFORM.RefreshButtons() ENDPROC PROCEDURE lstDocuments.ProgrammaticChange THIS.InteractiveChange() ENDPROC PROCEDURE lstDocuments.DblClick THISFORM.ExecDocument() IF NOT THISFORM.lNew THISFORM.Release() ENDIF ENDPROC PROCEDURE cmdOK.Click IF THISFORM.lNew THISFORM.ExecDocument() ELSE DODEFAULT() ENDIF ENDPROC 5PROCEDURE Timer IF THIS.Parent.lNoInterrupt * shouldn't happen RETURN ENDIF DODEFAULT() THIS.Parent.RefreshToolbars() LOCAL loMediator, loForm, llBusy IF TYPE("_SCREEN.ActiveForm") = "O" loForm = _SCREEN.ActiveForm ELSE STORE .F. TO THIS.Parent.lGoMenu, THIS.Parent.lNavToolbar RETURN ENDIF IF TYPE("loForm.Parent") = "O" AND ; INLIST(loForm.Parent.WindowType,WINDOWTYPE_MODAL, WINDOWTYPE_READMODAL) RETURN ENDIF IF loForm.WindowType = WINDOWTYPE_MODAL RETURN ENDIF loMediator = THIS.Parent.GetFormMediatorRef(_SCREEN.ActiveForm) IF VARTYPE(loMediator) = "O" THIS.Parent.lGoMenu = loMediator.lGoMenu THIS.Parent.lNavToolbar = loMediator.lNavToolbar ELSE STORE .F. TO THIS.Parent.lGoMenu, THIS.Parent.lNavToolbar ENDIF ENDPROC |Width = 154 Height = 28 BorderWidth = 0 Visible = .F. cstartupformclass = cstartupmenu = ccaption = cicon = nformcount = 0 npixeloffset = 22 lreadevents = .T. cappfolder = cdatafolder = cstartuptoolbarclass = cstartuptoolbarclasslib = ilasterror = .NULL. clastpath = clastonshutdown = clastonerror = clastdirectory = creference = cerrorlogtablename = ("AppError") cnewopenclass = cnewopenclasslib = cappfilename = oframe = .NULL. cgomenufile = ("GO_APP") cframeclass = cframeclasslib = caboutboxclass = caboutboxclasslib = chelpfile = coptionsdialogclass = coptionsdialogclasslib = creportdialogclass = creportdialogclasslib = cauthor = cimage = ccompany = cmetatable = cerrorviewerclass = cerrorviewerclasslib = cformmediatorname = ("app_mediator") cstartupmenupopup = cstartupmenupad = ctrademark = cnavtoolbarclass = cnavtoolbarclasslib = onavtoolbar = .NULL. cusertablename = ("AppUser") cusertablealias = lfavorites = .T. cstartupformclasslib = ccurrentuser = cuserloginclass = cuserloginclasslib = iinitialtoolbarposition = 0 ccopyright = laboutbox = .T. lstartupform = .T. lstartuptoolbar = .T. icurrentuserlevel = 0 cusertablelevelfield = ("UserLevel") cusertableidfield = ("UserName") cclasscontainerfilename = ("") cfavoritepopupname = ctextdisplayfont = ("Courier New") ccurrentuserfavoriteids = .NULL. clastmackey = cmackey = ("ALT-F10") cmacropopupname = cmacrosavefile = cchangepasswordclass = cchangepasswordclasslib = lusercanchangepassword = .T. cprojectname = lenableformsatruntime = .T. cmediatorclass = ("_FormMediator") cmediatorclasslib = ("_FRAMEWK.VCX") cmediatedsessionclass = ("_MediatedSession") cmediatedsessionclasslib = ("_FRAMEWK.VCX") csessionclass = csessionclasslib = iqueryunloadresultfornonvisualsessions = 0 cversion = Name = "_application" PROCEDURE Destroy DODEFAULT() THIS.oApp = .NULL. ENDPROC PROCEDURE Refresh LOCAL llActiveEditingControl IF THIS.lDisabledForModal RETURN ENDIF * .T. TO THIS.cmdNew.Enabled, ; * THIS.cmdOpen.Enabled, ; * THIS.cmdHelp.Enabled is already handled * automatically, now for specific button behavior: LOCAL ARRAY laTempx[1] LOCAL liSession IF TYPE("_SCREEN.ActiveForm") = "O" WITH _SCREEN.ActiveForm llActiveEditingControl = (TYPE(".ActiveControl.SelText") = "C") STORE llActiveEditingControl AND ; (NOT EMPTY(.ActiveControl.SelLength)) TO ; THIS.cmdCut.Enabled, THIS.cmdCopy.Enabled STORE llActiveEditingControl AND ; (NOT EMPTY(_CLIPTEXT)) TO ; THIS.cmdPaste.Enabled ENDWITH IF VARTYPE(THIS.oApp) # "O" STORE .F. TO THIS.cmdSave.Enabled, ; THIS.cmdRevert.Enabled, ; THIS.cmdPrint.Enabled, ; THIS.cmdHelp.Enabled ELSE liSession = IIF(UPPER(TYPE("_SCREEN.ActiveForm.Parent.BaseClass")) == ; "FORMSET", _SCREEN.ActiveForm.Parent.DataSessionID, ; _SCREEN.ActiveForm.DataSessionID) IF EMPTY(AUSED(laTempx, liSession)) STORE .F. TO THIS.cmdSave.Enabled, ; THIS.cmdRevert.Enabled, ; THIS.cmdPrint.Enabled ENDIF IF EMPTY(THIS.oApp.cHelpFile) STORE .F. TO THIS.cmdHelp.Enabled ENDIF ENDIF ELSE * no active form but may be system window ready for editing * etc... STORE .F. TO THIS.cmdSave.Enabled, ; THIS.cmdRevert.Enabled, ; THIS.cmdPrint.Enabled IF VARTYPE(THIS.oApp) # "O" OR EMPTY(THIS.oApp.cHelpFile) STORE .F. TO THIS.cmdHelp.Enabled ENDIF IF NOT EMPTY(WONTOP()) STORE .T. TO THIS.cmdCut.Enabled, ; THIS.cmdCopy.Enabled STORE (NOT EMPTY(_CLIPTEXT)) TO ; THIS.cmdPaste.Enabled ELSE STORE .F. TO THIS.cmdCut.Enabled, ; THIS.cmdCopy.Enabled, ; THIS.cmdPaste.Enabled ENDIF ENDIF ENDPROC _cstartupformclass Form (SCX) which is executed when the application object is shown. cstartupmenu Menu (MPR) which is executed when the application object is shown. ccaption Friendly name of the application object. cicon Icon of the application object. nformcount Forms collection count for application object. npixeloffset Number of pixels which offset multiple instances of the same form. Not used in this version, but can provide a useful value for default "margins" for form and object placement. lcascadeforms Specifies whether multiple forms of the same type are cascaded when a new form is instanced. lreadevents Enable READ EVENTS within ReadEvents method. cappfolder Location of application, usually top level file, but sometimes the location of the module that owns the VCX of this application object. Indicates default location of generated system files such as error and user tables. cdatafolder Not used internally, allows you to maintain a current location for your data or for user-generated files. cstartuptoolbarclass Standard toolbar instantiated by ShowStartupElements(). cstartuptoolbarclasslib Class library for standard toolbar instantiated by ShowStartupElements(). If empty defaults to same class library as application object. ilasterror Stores error number of last number, or NULL when cleared. clastpath Stores SET("PATH") when a readevents-type application starts up, for later restoration. clastonshutdown Stores ON SHUTDOWN when a readevents-type application starts up, for later restoration. clastonerror Stores ON ERROR when a readevents-type application starts up, for later restoration. clastdirectory Stores default directory when a readevents-type application starts up, for later restoration. creference The var name that the app should declare as its PUBLIC reference and release when it ends. lrestoredenvironment cerrorlogtablename Default table name for error log. cnewopenclass Dialog class instantiated by DoNewOpen(). cnewopenclasslib Class library for dialog class instantiated by DoNewOpen(). If empty defaults to same class library as application object. laddingnewdocument Application flag a form can check to see whether it should start a new document rather than edit an existing one. cappfilename Top level filename lgomenu Specifies whether a navigation menu is currently required. oframe Reference to MDI frame window in top form applications. cgomenufile Name of menu to be used when a form entry in the meta table indicates that it should have a navigation menu. cframeclass Dialog class instantiated by CreateFrame(). cframeclasslib Class library for dialog class instantiated by CreateFrame(). If empty defaults to same class library as application object. caboutboxclass Name of dialog class instantiated by DoAboutBox() caboutboxclasslib Class library for dialog class instantiated by DoAboutBox(). If empty defaults to same class library as application object. chelpfile Name of help file for this application. coptionsdialogclass Dialog class instantiated by DoOptionsDialog(). coptionsdialogclasslib Class library for dialog class instantiated by DoOptionsDialog(). If empty defaults to same class library as application object. creportdialogclass Dialog class instantiated by DoReportDialog(). creportdialogclasslib Class library for dialog class instantiated by DoReportDialog(). If empty defaults to same class library as application object. cauthor "Credits" information. cimage Image to be used in logos, on the splash screen, etc. ccompany "Credits" information. luse_getexpr Determines whether the application -- or the current user -- should use _GETEXPR or the simpler _FilterDialog to enter expressions. cmetatable Stores the name of the application's metatable. cerrorviewerclass Dialog class instantiated by DisplayErrorLog(). cerrorviewerclasslib Class library for dialog class instantiated by DisplayErrorLog(). If empty defaults to same class library as application object. lfindonmultipletables Specifies whether the ShowTableFindDialog will allow the user to switch to different tables in use in the data session. cformmediatorname Member name the app object looks for when contacting a mediator object on framework-enabled forms. cstartupmenupopup For non-ReadEvents/Append style app menus, allows the application to release this popup when the app ends. cstartupmenupad For non-ReadEvents/Append style app menus, allows the application to remove this menu pad when the app ends. ctrademark "Credits" information. lnoscreenduringapp Specifies whether screen should not be made visible during the app. cnavtoolbarclass Toolbar class when a metatable entry calls for a navigation toolbar. cnavtoolbarclasslib Class library for toolbar class when a metatable entry calls for a navigation toolbar. If empty defaults to same class library as application object. onavtoolbar Reference to navigation toolbar shared by various forms as indicated in their metatable entries. lnavtoolbar Specifies whether a navigation toolbar is currently required. cusertablename Name of user table. cusertablealias Alias for user table. luserpreferences Determines whether the user logon and options system is in place, or whether one set of options is set up for the full application. lfavorites Specifies whether Favorites should be used/shown on a menu in this application. cstartupformclasslib Class library for dialog class instantiated by DoStartupForm(). If empty defaults to same class library as application object. ccurrentuser Name of current user as logged on. cuserloginclass Dialog class instantiated by DoUserLogin(). cuserloginclasslib Class library for dialog class instantiated by DoUserLogin(). If empty defaults to same class library as application object. iinitialtoolbarposition Indicates how a toolbar should be Docked() when instantiated. ccopyright "Credits" information. laboutbox Indicates whether app should display an about box. lstartupform Specifies whether the app should begin with a "quick start" form. lstartuptoolbar Specifies whether the app should invoke a toolbar at startup. icurrentuserlevel Current user's level. cusertablelevelfield Name of i-type field storing user level. cusertableidfield Name of c-type field storing user name. cclasscontainerfilename APP,EXE, or DLL containing the VCX from which this app object was instantiated. lskiperrorhandling Flag to allow an error number to be stored with no further error handling, for certain brief activities within the app. cfavoritepopupname Name of popup displaying favorites. Required so the app object can refresh this popup between users or when a user selects new Favorites. ctextdisplayfont A sample "global user pref", allows users to store a font for display of text such as editboxes. To see it used, see the error log dialog.ApplyAppAttributes. The app gives this value to _outputdialog, applying it to the dialog's cDisplayFontName. ccurrentuserfavoriteids A delimited string containing IDs of metatable entries that should be included in Favorites list as well as filenames picked by user for inclusions in Favorites list. clastmackey Stores SET MACKEY when a readevents-type application starts up, for later restoration. cmackey Supplies the SET MACKEY for the application. Only used in ReadEvents apps. cmacropopupname Name of popup handling macro sets. Required so the app object can refresh this popup between users, when the user stores a macro set, etc. cmacrosavefile Stores the (generated) name of an FKY file created on startup of a ReadEvents app, for later restoration. lusernameiscasesensitive Determines how the user table is searched for a match when a user logs in. cchangepasswordclass Dialog class instantiated by DoChangePassword(). cchangepasswordclasslib Class library for dialog class instantiated by DoChangePassword(). If empty defaults to same class library as application object. lusercanchangepassword Determines whether DoChangePassword() will allow the user to change his or her password. A placeholder -- you affect this behavior by using the attached access and assign methods however you decide, for example by user level. cprojectname Name of a project that should be hidden on startup, for display at the end of the application. For convenience (so you don't inadvertently try to work on an app component while it's running, especially in non-ReadEvents or top form apps). lsavedenvironment lreleaseunusedmenuitems Indicates whether some menu items specific to application state should be released rather than disabled, when the MPR executes, if they are inappropriate. Used by framework's template menus. lenableformsatruntime Indicates whether DoForm() will dynamically adds base mediator objects to forms at runtime if they don't already have them. cmediatorclass Class used for dynamic form enabling at runtime (see lEnableFormsAtRuntime.) Should always contain a class descended from _formmediator in _FRAMEWK.VCX. cmediatorclasslib Classlibrary used for dynamic form enabling at runtime (see lEnableFormsAtRuntime). Should always be the name of the library containing the class specified in _application.cMediatorClass. cmediatedsessionclass Name of class used to instance a framework-enabled datasession object, defaults to "_MediatedSession" cmediatedsessionclasslib Classlib containing cMediatedSession class, defaults to "_FRAMEWK.VCX" csessionclass Default class definition name to pass to any _MediatedSession collaborator. If empty will be filled by member's cSessionClass property after successful instantiation. csessionclasslib Default programmatic class definition filename to pass to any _MediatedSession collaborator. If empty will be filled by member's cSessionClassLib property after successful instantiation. iqueryunloadresultfornonvisualsessions Used by ReleaseSessions method -- if 0, reverts, if 1, updates, otherwise asks user for confirm just like forms. Defaults to 0. lnointerrupt Flag to alert application object that current activity, such as data-session-changing or modal dialogs, should not be interrupted by toolbar-refreshing or other timer-related activity. *show Sets up visible aspects of the application and, if successful, Activate()s the application, at startup. *doform Executes an SCX form or instantiates a VCX-based form/formset class. *doreport Executes an FRX or LBX report form. *dolabel Executes an LBX label *domenu Executes an MPR/MPX menu. *clearevents Clears any pending read events. *readevents Starts read events mode. *doprogram Executes a PRG, APP, FXP, or EXE program. *saveenvironment Saves environment settings. *restoreenvironment Restores environment settings. ^aforms[1,0] *filenotfoundmsgbox Displays a File Not Found messagebox. *beforereadevents Method executed before READ EVENTS is executed when ReadEvents is called. *onshutdown Occurs when the user attempts to exit Visual FoxPro by pressing _SCREEN close button or the close button on a framework top form MDI frame. *releaseforms Release all application forms from memory and the forms collection. *releaseform Release specific or active form and manages forms collection. ^aformnames[1,0] Collection of strings (for SCXs, file names, for VCXs, file and class names), enabling the application object to uniquely identify form and formset classes currently instantiated and referenced in its aForms() collection. *resetformscollection Reset arrays and counters of forms collection. *refreshformscollection Refresh forms collection arrays and counters. *refreshtoolbars Called by member timer and at any other time you need to synch toolbars to current environment. Iterates through toolbar collection calling Refresh methods so that it doesn't assume any tbr class. *dotoolbar Parallel to DoForm. Maintains toolbars collection. Pass a toolbar class library & class name. Uses THIS.iInitialToolbarPosition to set position. *releasetoolbar Parallel to ReleaseForm. Maintains toolbars collection. *releasetoolbars Parallel to ReleaseForms. Iterates through toolbar collection *releasecollaborators Manages release of collaborative objects *createcollaborators A startup hook to allow you to call the AddCollaborators() method during initialization procedures *instantiate RETURNs object reference -- pass classname, classlib, APP/EXE if library is external, string of delimited parameters to be macro-executed. If being added as a member, also pass container ref plus membername if it's not OK to use unique/generated name. ^acollaborators[1,0] Collection of object references for members that cannot be contained by custom application object, such as forms *getcurrenttopformref Wraps cusWindowHandler's GetCurrentTopFormRef() method. *iserrorfree RETURNs ISNULL(THIS.iLastError) -- See THIS.ClearLastError(). *clearlasterror Sets _application.iLastError to NULL, called before operations which may require an error to be tested on conclusion. Abstracted for easy overriding in subclasses. *getresourcefilename Pass: tcSource, tcExtList, tlSuppressMsg, looks for file with any of extensions in list, in order, to RETURN the appropriate pathed name ("" if none, with File Not Found msg unless tlSuppressMsg). Ignores tcExtlList if explicit ext passed in tcSource. *setenvironment Sets up certain global attributes, such as screen or frame characteristics, ON SHUTDOWN, ON ERROR, and macros for use during the life of the app. Does *nothing* if not a ReadEvents app. *donewopen Invokes cNewOpenClass *displayerrorlog Instantiates cErrorViewerClass dialog *beforedoform Hook in DoForm method, allowing last-minute manipulation of environment before the form class or object is instantiated. *querydatasessionunload Wraps cusDataSession member's Queryunload() method. *setappfilenames Get top-level filename, and also get the name of the module (app or exe) that owns this particular object, for SET CLASSLIB ... IN... default usage, which may be different, especially in modular and non-ReadEvents apps. ^atoolbars[1,2] Parallel to aForms[] *querydatachanged Wraps cusDataSession member's DataChanged() method. *dataupdate Wraps cusDataSession's Update() method. *datarevert Wraps cusDataSession's Revert() method. *ccaption_access *ccaption_assign *cicon_assign *ilasterror_access *cdatafolder_assign *creference_assign *cappfolder_access Determines the application folder, usually the folder containing the running APP or EXE. However where a temporary wrapper program or ON... command has been used to instantiate the application, this value may be the location of the VCX *lgomenu_assign *doreportdialog Invokes cReportDialogClass *doaboutbox Invokes cAboutBoxClass dialog class *dooptionsdialog Invokes cOptionsDialogClass *docontextmenu Manages context menus and context menu collection *releasecontextmenu Manages release of a single context menu and the context menu collection. *dohelp Executes help of types .hlp, .dbf, .htm, or .chm *domodaldialogclass Instantiates a modal dialog, applying application attributes as appropriate. RETURNs a form reference, if NOSHOW. *cascadeform For backwards compatibility, not used *cascadeall Wraps cusWindowHandler's CascadeFormInstances() method, passing no argument. *dosort Wraps cusTableSort's DoSort() method. *gotop Wraps cusTableNav member's GoTop() method. *gobottom Wraps cusTableNav member's GoBottom() method. *gonext Wraps cusTableNav member's GoNext() method. *goprevious Wraps cusTableNav member's GoPrevious() method. *showtablegotodialog Instantiates _GoToDialog class. *showtablefinddialog Instantiates _FindDialog class, in advanced or standard mode, depending on THIS.lFindOnMultipleTables value. (Advanced mode allows the user to choose between all open aliases in a data session.) *showtablesetfilterdialog Instantiates _FilterExpr class, in advanced or standard depending on THIS.lUseGetExpr value. (Standard mode uses _FilterDialog as a subsidiary dialog, Advanced uses _GETEXPR.) *releasecontextmenus Releases all context menus. *setdatasessionenvironment Sets a specified data session to a default set of SETs, which you place in the SetDataSessionSets for use by any form or session you want. *setdatasessionsets Contains a default list of data-session-related SETs so you can easily invoke this list within any form or datasesion. *cimage_assign Verifies the availability of an image file for use as the application logo *cerrorlogtablename_access adds cAppFolder information to the error log table name, so the default error DBF is always in one place. *addcollaborator Instantiate objects that can't be part of application container and add a reference to collaborators collection for maintenance. See SetScreenAttributes() for examples. *getformmediatorref Returns a reference to a form's mediator object, or NULL if the form is not framework-enabled with a mediator object. *formisframeworkenabled Reports the existance of a mediator object on a form. Uses THIS.cFormMediatorName to determine the naming convention for this object on the form. *createframe Creates the MDI frame for top form applications. *releaseframe Releases top form/MDI frame. *setscreenattributes Sets up screen attributes, including visibility, caption and icon, and system toolbars, for a read events app that does not take place in its own topform MDI frame. *setframeattributes Applies application cCaption and cIcon to the MDI frame, as well as the appropriate backcolor for an MDI frame window. *showstartupelements Sets up top form MDI frame, startup menu, startup toolbar, screen attributes, and startup form. *activatesystemwindow Activates a system window whose name has been passed, in _SCREEN, even if _SCREEN wasn't previously visible (for debugging, does nothing in runtime) *domenuiteminframe Not currently used, wraps cusWindowHandler method *lnavtoolbar_assign *gotorecord Wraps cusTableNav member's GoToRecord() method. *getcurrentalias Wraps the cusTableNav member's GetCurrentAlias() method. *dotableoutput Looks at the current form/alias and invokes the _outputdialog class appropriately for a table. Scope 1 or all. Hooks mediator's PrepareOutputAlias() and CleanupOutputAlias(), for framework-enabled forms, and app.SetHTMLClass/SetHTMLStyleID for GENHTML. *cusertablename_access *cusertablealias_assign *setcurrentuser Finds the current user and sets up the app to deal with the current user (permissions, options, favorites, and macros may all change per user). *dostartupform Instantiates cStartupFormClass dialog *iinitialtoolbarposition_assign *caboutboxclass_access Synchronizes classname value with lAboutBox value *cstartupformclass_access Synchronizes classname value with lStartupForm value *cstartuptoolbarclass_access Synchronizes classname value with lStartupToolbar value *dodocumentpickerdialog Invokes all the dialogs descending from the _documentpicker dialog superclass ^acontextmenus[1,4] Manages context menus invoked by the application object. *setuserpermissions Abstract in the base. Called when a new user logs on. Designed to use iCurrentUserLevel property, derived from user table, to maintain groups. Menu items would be added/substracted/enabled/disabled based on group level at this time. *seekcurrentuser This method finds the current user using an exact match (case sensitivity depends on THIS.lUserNameIsCaseSensitive). *createusertable Creates and indexs user table when it does not exist. Abstracted for easy editing. The app expects this table to have 1 c-type field, with its name in the cUserTableIDField property, and 1 i-type field, its name in cUserTableLevelField. *douserlogin Invokes cUserLoginClass dialog. Returns (NOT EOF(THIS.cUserTableAlias)) to indicate success at locating a user. *filluseroptionsarray Moves the user table's UserOpts contents to aCurrentUserOpts. Array has 4 columns: property name, value, toggle property or SET, datasession or global attribute *applyuseroptsforsession Applies datasession-specific options a form object and its session environment. ^acurrentuseropts[1,4] Holds user preferences for use globally (by the app object and global SETs) or in a data session (by a form or formset object and data-session-specific SETs). *seekdefaultuser This method finds a record with a blank user name where default options and favorites are stores, for use when defining a new user or when user logins and separate user profiles are not required. *applyglobaluseroptions Applies global (non-datasession-specific) options to the _application object and environment. Where user login and preferences are not used, applies a single set at startup -- with user login and preferences, applies to each user login. *getuseroptionsetting Takes option name and array (usually aCurrentUserOpts) and returns current value for that option, NULL if not found. *purgeerrorlog Zaps current error log with appropriate confirmation and checks. *exporterrorlog Invokes _outputdialog class to allow output of error log information. *refreshfavoritepopup DEFINEs BARs for Favorites menu popup using THIS.cCurrentUserFavoriteIDs. *ctextdisplayfont_assign *seekmetatablefavoriteid Finds a record in the meta table using an identification specified in #DEFINE APP_META_FAVE_ID in _FRAMEWK.H. Override this method if you decide to use a more sophisticated method of identifying records in the metatable! *setmacros Saves and restores a set of macros using the user table. Synchronizes enabling of bars on the macro-handling popup, using THIS.cMacroPopupName, depending on current set of user macros. *setcurrentuserfavoriteids Saves and restores THIS.cCurrentUserFavoriteIDs information to UserFave memo field in user table. This memo field also contains date information, so user can opt to clear favorites list if metatable has changed since user has identified favorites. *dofile Executes files, channelling known FoxPro-type files to appropriate application Do... methods, and files of unknown types through Windows API *clearfavorites Called by Favorites menu item, to confirm "zap" of user favorites and invoke SetCurrentUserFavoriteIDs mechanism. *storepassword Stores the encrypted value of a new password to the current record in the user table. *createstoredpassword Creates an encrypted value of a password. Separated from StorePassword() for easy replacement of its simple algorithm. Algorithms in CreateStoredPassword and CheckValueAgainstStoredPassword should match. *checkpassword Sends a passed value and a stored value from the current user information to CheckValueAgainstStoredPassword for verification. *checkvalueagainststoredpassword Compares a current password entry against an encrypted stored entry. Separated from CheckPassword so its simple algorithm can be replaced as necessary. Algorithms in CreateStoredPassword and CheckValueAgainstStoredPassword should match. *lusercanchangepassword_access *lusercanchangepassword_assign *dochangepassword Invokes cChangePasswordClass dialog class *handleprojectwindow Hides a project with the name stored in THIS.cProjectName on startup, if it is showing, and restores it when the app object Destroys. *doformnoshow Executes an SCX form or instantiates a VCX-based form/formset class, without Showing it, and returning a reference to the form or formset instantiated. *sethtmlstyleid Abstract. Takes parameters tcSource (report form or alias/table), tlTable, so you can decide what HTMLClass is appropriate. Passed to GENHTML via _outputdialog attributes. *sethtmlclass Abstract. Takes parameters tcSource (report form or alias/table), tlTable, so you can decide what HTMLClass is appropriate. Passed to GENHTML via _outputdialog attributes. *activate Makes the application active *activateforminframe Takes a form or toolbar reference and fixes it to appear in top form "frame" even if its ShowWindow property was 0 *createformmediator Adds a app mediator object to a form *validatemetatable Ensures that a table contains a valid and available table for documents registry. Validates THIS.cMetatable, if used, on startup. *addmediatedsession Creates a data session with a mediator object attached, referenced in the aCollaborators collection, returns a reference to this framework-enabled session. *releasesessions Releases all mediated datasession collaborator objects *lnointerrupt_assign |PROCEDURE show LOCAL llSuccess llSuccess = THIS.SaveEnvironment() IF llSuccess llSuccess = THIS.ValidateMetaTable() ENDIF IF llSuccess llSuccess = THIS.CreateFrame() ENDIF IF llSuccess AND NOT EMPTY(APP_LOADING_LOC) IF VARTYPE(THIS.oFrame) = "O" THIS.oFrame.Show() ENDIF WAIT WINDOW NOWAIT ; LEFT(APP_LOADING_LOC,254) ENDIF IF llSuccess llSuccess = THIS.ResetFormsCollection() ENDIF IF llSuccess llSuccess = THIS.CreateCollaborators() ENDIF IF llSuccess llSuccess = THIS.HandleProjectWindow() ENDIF IF llSuccess llSuccess = THIS.SetEnvironment() ENDIF IF llSuccess THIS.cUserTableAlias = JUSTSTEM(THIS.cUserTableName) llSuccess = NOT EMPTY(THIS.cUserTableAlias) ENDIF IF llSuccess llSuccess = THIS.SetCurrentUser() ENDIF IF llSuccess llSuccess = THIS.ShowStartupElements() ENDIF WAIT CLEAR IF llSuccess llSuccess = THIS.Activate() ENDIF THIS.RestoreEnvironment() RETURN llSuccess ENDPROC PROCEDURE doform LPARAMETERS tcFileName,tcClass,tlNoMultipleInstances,tlNoShow, tlGoMenu, tlNavToolbar ASSERT EMPTY(tcFileName) OR VARTYPE(tcFileName) = "C" ASSERT EMPTY(tcClass) OR VARTYPE(tcClass) = "C" LOCAL lcFileName,lcClass,lnCount, lcFormName,lnFormCount, loMediator, ; loForm, loFormMember, lNeedReActivateFormset, ; llFormSet,llEnabledFormFound *&* VFP 5 framework cascade code also used: *&* LOCAL lnTop,lnLeft,loForm2,lcName THIS.ClearLastError() lcFileName=ALLTRIM(tcFileName) lcClass=IIF(VARTYPE(tcClass)="C",LOWER(ALLTRIM(tcClass)),"") IF EMPTY(lcClass) lcFileName = THIS.GetResourceFileName(lcFileName,".scx") ELSE lcFileName = THIS.GetResourceFileName(lcFileName,".vcx") ENDIF IF EMPTY(lcFileName) RETURN .F. ENDIF lcFormName=IIF(EMPTY(lcClass),lcFileName,lcFileName+","+lcClass) IF tlNoMultipleInstances FOR lnCount = 1 TO THIS.nFormCount IF THIS.aFormNames[lnCount]==lcFormName AND ; VARTYPE(THIS.aForms[lnCount])="O" IF UPPER(THIS.aForms[lnCount].BaseClass)== "FORM" AND ; THIS.aForms[lnCount].WindowState = 1 && minimized THIS.aForms[lnCount].WindowState = 0 ENDIF IF VARTYPE(THIS.oFrame) = "O" THIS.oFrame.Show() ENDIF THIS.aForms[lnCount].Show RETURN .F. ENDIF ENDFOR ENDIF * this is a hook, nothing in it IF NOT THIS.BeforeDoForm(tcFileName,tcClass,tlNoMultipleInstances,tlNoShow, tlGoMenu, tlNavToolbar) RETURN .F ENDIF THIS.RefreshFormsCollection THIS.nFormCount=THIS.nFormCount+1 DIMENSION THIS.aForms[THIS.nFormCount],THIS.aFormNames[THIS.nFormCount] THIS.aFormNames[THIS.nFormCount]=lcFormName IF VARTYPE(THIS.oFrame) = "O" THIS.oFrame.Show() ENDIF IF NOT EMPTY(lcClass) THIS.aForms[THIS.nFormCount] = ; THIS.Instantiate(lcClass, lcFileName) ELSE DO FORM (lcFileName) NAME THIS.aForms[THIS.nFormCount] LINKED NOSHOW ENDIF lnFormCount=THIS.nFormCount THIS.RefreshFormsCollection IF THIS.nFormCount>=lnFormCount * success so far, * let's enable and position the new object(s) * and then show it/them if we're supposed to: loForm = THIS.aForms[THIS.nFormCount] llFormSet = (UPPER(loForm.BaseClass) == "FORMSET") IF llFormSet FOR EACH loFormMember IN loForm.Forms IF UPPER(loFormMember.BaseClass) == "FORM" * skip toolbars loMediator = THIS.GetFormMediatorRef(loFormMember) * don't force until we know about all forms * in set; see note below IF VARTYPE(loMediator) = "O" loMediator.LoadApp(THIS.cReference) loMediator.lGoMenu = tlGoMenu loMediator.lNavToolbar = tlNavToolbar llEnabledFormFound = .T. ENDIF ENDIF ENDFOR ELSE loMediator = THIS.GetFormMediatorRef(THIS.aForms[THIS.nFormCount], ; THIS.lEnableFormsAtRunTime) * second param will force creation * if lEnableFormsAtRuntime is on IF VARTYPE(loMediator) = "O" loMediator.LoadApp(THIS.cReference) loMediator.lGoMenu = tlGoMenu loMediator.lNavToolbar = tlNavToolbar ENDIF ENDIF * if any forms in the formset are enabled, * some may have been left un-enabled by * intent, so that they don't get icon or whatever. * So if even one form in the formset is enabled * we won't dynamically enable the rest. That's * why the below FOR/ENDFOR has to be done separately * from the above attempt to load mediators in a formset: IF llFormSet AND ; (NOT llEnabledFormFound) AND ; THIS.lEnableFormsAtRunTime THIS.ClearLastError() FOR EACH loFormMember IN loForm.Forms IF UPPER(loFormMember.BaseClass) == "FORM" loMediator = THIS.CreateFormMediator(loFormMember) IF VARTYPE(loMediator) = "O" loMediator.LoadApp(THIS.cReference) loMediator.lGoMenu = tlGoMenu loMediator.lNavToolbar = tlNavToolbar ENDIF ENDIF ENDFOR ENDIF IF NOT tlNoShow IF VARTYPE(THIS.oFrame) # "O" IF llFormSet * there is something screwy about * formsets when some forms may be showwindow 0 * and others 1, even in _SCREEN, so it's * best to show each form separately: FOR EACH loFormMember IN loForm.Forms loFormMember.Show() ENDFOR ELSE loForm.Show() ENDIF ELSE * seems as though if even one form in * the formset is ShowWindow = 0, * then all forms must be brought into the top form IF llFormSet FOR EACH loFormMember IN loForm.Forms IF loFormMember.ShowWindow = 0 lNeedReActivateFormset = .T. EXIT ENDIF ENDFOR FOR EACH loFormMember IN loForm.Forms IF lNeedReActivateFormset THIS.ActivateFormInFrame(loFormMember) ELSE loFormMember.Show() ENDIF ENDFOR ELSE IF loForm.ShowWindow = 0 THIS.ActivateFormInFrame(loForm) ELSE loForm.Show() ENDIF ENDIF ENDIF ENDIF IF THIS.lCascadeForms AND NOT llFormSet THIS.CascadeAll(loForm.Name) *&* this is where VFP framework used THIS.nPixelOffset, *&* all that code removed but the property might still *&* be useful somewhere ENDIF ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE doreport LPARAMETERS tcFileName, tcDescription, tlModify ASSERT EMPTY(tcFileName) OR VARTYPE(tcFileName) = "C" ASSERT EMPTY(tcDescription) OR VARTYPE(tcDescription) = "C" LOCAL lcFileName THIS.ClearLastError() IF (EMPTY(tcFileName) AND NOT tlModify) RETURN .F. ENDIF lcFileName=ALLTRIM(tcFileName) lcFileName= THIS.GetResourceFileName(lcFileName,".frx .lbx", tlModify) IF tlModify * if EMPTY(lcFileName) * confirm creation, use template? * else MODIFY * not yet implemented MESSAGEBOX(APP_FEATURE_NOT_AVAILABLE_LOC, ; MB_ICONINFORMATION,THIS.cCaption) ELSE IF EMPTY(lcFileName) RETURN .F. ENDIF * we can provide output *without* going through the * user's choices in the dialog at all, simply * by instantiating an _output object and setting * its properties rather than going through this dialog * This is not implemented here, because it * would definitely require that you set properties, * as below. Would make sense for a subclass app object * to have a lWantOutputDialog property which defaults .T. * If the dialog is not desired, augment the * standard behavior by looking for developer's * information -- whether in the metatable or elsewhere * about destination and options settings. LOCAL loDialog loDialog = THIS.DoModalDialogClass("_outputdialog","_reports", .T.) * note: could add a metatable check here to fill out loDialog.cAlias * or loDialog.cFieldList, or loDialog.cAddedParams... * could prefill the destination... * also note that this dialog doesn't, strictly speaking, have to * be modal, but we're calling it from a modal dialog (the picker) so * it seems reasonable to keep it modal here. We could subclass it * to know how to be a singleton, like the error dialog, instead... * and automatically know about app attributes, rather than * using the generic gallery version and adjusting it. IF VARTYPE(loDialog) = "O" LOCAL laRecNos[1], laWorkAreas[1], ; liUsed, liRow, lcAlias liUsed = AUSED(laWorkAreas) * Unlike DoTableOutput(), we really * have no clue in this method what * workareas might be affected by * the named report or label form, so * should take care of all current * record pointers, * assuming that any workareas at all * are affected in the current data * session. * Because it has a custom property * allowing a new alias to be selected * before output is generated, the * _output object saves and * restore current workarea, * after output is generated -- so * that (at least) is not an issue here. * Note also that the report either has its * own datasession, which has been * disposed of separately, * or it takes place in this * datasession, so no save/restore * of data sessions should be necessary. * We will stipulate that any custom * datasession objects that a report * might open, and even create a public * reference to, should not affect the * environment of the application * at the time this method was called. * Any additional aliases open in * this datasession by the running * report which are not closed by * the report will not be affected * by this code. * However, see remarks about VUE * file below. IF liUsed > 0 DIMENSION laRecNos[liUsed] FOR liRow = 1 TO liUsed lcAlias = laWorkAreas[liRow,1] IF EOF(lcAlias) laRecNos[liRow] = 0 ELSE laRecNos[liRow] = RECNO(lcAlias) ENDIF ENDFOR ENDIF * We must allow for the fact that * reports can cause errors -- either * because being invoked in this generic * way they don't have access to the data * they need or a UDF causes an error. THIS.lSkipErrorHandling = .T. loDialog.Icon = THIS.cIcon IF EMPTY(tcDescription) loDialog.Caption = loDialog.Caption+" "+ ; PROPER(JUSTFNAME(lcFileName)) ELSE loDialog.Caption = loDialog.Caption + " "+tcDescription ENDIF loDialog.cHTMLClass = THIS.SetHTMLClass(tcFileName) loDialog.cHTMLStyleID = THIS.SetHTMLStyleID(tcFileName) loDialog.lAddSourceNameToDropDown = .F. loDialog.cReport = lcFileName loDialog.lPreventSourceChanges = .T. loDialog.Show(1) loDialog = .NULL. * This "restore" code does *not* * handle any dropped or changed * relations that might occur in the the * FRX or LBX data environment. * Neither does it handle the possibility * that a UDF attached to the report * or label might actually close a table, * except in the most basic way, and * there could be many other * unforeseen changes * to the current data session that could * take place in a UDF. * If complete save and restore behavior * is desirable, a VUE file * should be CREATEd earlier to a * generated tempfile name, SET here * and then ERASEd, followed by * record-pointer-restoring code similar * to the following. IF liUsed > 0 FOR liRow = 1 TO liUsed lcAlias = laWorkAreas[liRow,1] IF NOT USED(lcAlias) LOOP ENDIF IF laRecNos[liRow] = 0 GO BOTTOM IN (lcAlias) SKIP IN (lcAlias) ELSE GO (laRecNos[liRow]) IN (lcAlias) ENDIF ENDFOR ENDIF IF (NOT THIS.IsErrorFree()) MESSAGEBOX(REPORT_RUN_ERROR_LOC,MB_ICONSTOP,THIS.cCaption) ENDIF THIS.lSkipErrorHandling = .F. ELSE RETURN .F. ENDIF ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE dolabel LPARAMETERS tcFileName, tcDescription ASSERT EMPTY(tcFileName) OR VARTYPE(tcFileName) = "C" ASSERT EMPTY(tcDescription) OR VARTYPE(tcDescription) = "C" LOCAL lcFileName, lcDescription THIS.ClearLastError() lcFileName=ALLTRIM(tcFileName) IF EMPTY(lcFileName) RETURN .F. ENDIF lcFileName= THIS.GetResourceFileName(lcFileName,".lbx") IF EMPTY(lcFileName) RETURN .F. ENDIF IF EMPTY(tcDescription) lcDescription = PROPER(JUSTSTEM(lcFileName)) ELSE lcDescription = tcDescription ENDIF THIS.DoReport(lcFileName, lcDescription) RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE domenu LPARAMETERS tcFileName, tlUniquePopupNames ASSERT EMPTY(tcFileName) OR VARTYPE(tcFileName) = "C" LOCAL lcFileName THIS.ClearLastError() lcFileName=ALLTRIM(tcFileName) IF EMPTY(lcFileName) RETURN .F. ENDIF lcFileName= THIS.GetResourceFileName(lcFileName,".mpx .mpr") IF EMPTY(lcFileName) RETURN .F. ENDIF IF VARTYPE(THIS.oFrame) # "O" DO (lcFileName) ELSE DO (lcFileName) WITH THIS.oFrame, THIS.oFrame.cMenuName, tlUniquePopupNames ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE clearevents THIS.ClearLastError() IF THIS.lReadEvents CLEAR EVENTS ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE readevents THIS.ClearLastError() IF THIS.lReadEvents READ EVENTS ENDIF ENDPROC PROCEDURE doprogram LPARAMETERS tcFileName ASSERT EMPTY(tcFileName) OR VARTYPE(tcFileName) = "C" LOCAL lcFileName THIS.ClearLastError() lcFileName=ALLTRIM(tcFileName) IF EMPTY(lcFileName) RETURN .F. ENDIF * the following uses the order of precedence * to determine the appropriate extension: * .EXE (executable version) * .APP (an application) * .FXP (compiled version) * .PRG (program) * this program will run an SPR/SPX or QPR/QPX * as well as the explicit list that * VFP will run if you don't supply an extension, * if you pass the name with an extension. * This is consistent with the native behavior. lcFileName= THIS.GetResourceFileName(lcFileName,".exe .app .fxp .prg") IF EMPTY(lcFileName) RETURN .F. ENDIF IF VERSION(2) = 0 AND ; UPPER(JUSTEXT(lcFileName)) == "PRG" IF NOT EMPTY(SYS(2000,lcFileName)) * FXP was not found and PRG is on disk, * not built in to a file COMPILE (lcFileName) lcFileName = FORCEEXT(lcFileName,"FXP") ELSE RETURN .F. ENDIF ENDIF DO (lcFileName) RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE saveenvironment IF THIS.lReadEvents THIS.cLastOnShutDown = ON("SHUTDOWN") THIS.cLastPath = SET("PATH") THIS.cLastOnError = ON("ERROR") THIS.cLastDirectory = SET("DIRECTORY") THIS.cLastMacKey = SET("MACKEY") THIS.cMacroSaveFile = THIS.cAppFolder+"M"+SYS(2015)+".FKY" THIS.lSkipErrorHandling = .T. SAVE MACROS TO (THIS.cMacroSaveFile) THIS.lSkipErrorHandling = .F. IF EMPTY(THIS.cFrameClass) AND ; (NOT EMPTY(THIS.cStartupMenu)) PUSH MENU _MSYSMENU ENDIF ENDIF THIS.lSavedEnvironment = .T. ENDPROC PROCEDURE restoreenvironment IF THIS.lRestoredEnvironment OR ; (NOT THIS.lSavedEnvironment) RETURN .T. ENDIF THIS.ClearLastError() LOCAL lcTemp IF THIS.lReadEvents lcTemp = THIS.cLastOnShutDown ON SHUTDOWN &lcTemp lcTemp = THIS.cLastOnError ON ERROR &lcTemp lcTemp = THIS.cLastMacKey SET MACKEY TO &lcTemp SET PATH TO (THIS.cLastPath) CD (THIS.cLastDirectory) IF FILE(THIS.cMacroSaveFile) CLEAR MACROS && restore macros is additive RESTORE MACROS FROM (THIS.cMacroSaveFile) ERASE (THIS.cMacroSaveFile) NORECYCLE ENDIF IF EMPTY(THIS.cFrameClass) AND (NOT EMPTY(THIS.cStartUpMenu)) RELEASE MENU _MSYSMENU EXTENDED POP MENU _MSYSMENU ENDIF ENDIF THIS.lRestoredEnvironment = .T. RETURN THIS.IsErrorFree() ENDPROC PROCEDURE filenotfoundmsgbox LPARAMETERS tcFileName IF INLIST(_VFP.Startmode, 0, 4) MESSAGEBOX(APP_FILE_NOT_FOUND_LOC+":"+; CHR(13) + CHR(13)+ ; tcFileName,MB_ICONEXCLAMATION,THIS.cCaption) ELSE THIS.cusError.RecordServerError(; THIS.cCaption+ ": "+APP_FILE_NOT_FOUND_LOC) ENDIF ENDPROC PROCEDURE onshutdown LPARAMETERS tlCalledFromTopForm LOCAL llReturn, llInterrupted DO CASE CASE INLIST(_VFP.StartMode,1,2,3,5) * we really shouldn't be here at all llReturn = .T. CASE TYPE("_SCREEN.ActiveForm.Parent") = "O" AND ; _SCREEN.ActiveForm.Parent.WindowType = 1 && modal * formset overrides form on this one ?? CHR(7) CASE TYPE("_SCREEN.ActiveForm") = "O" AND ; _SCREEN.ActiveForm.WindowType = 1 ?? CHR(7) OTHERWISE llReturn = .T. ENDCASE IF llReturn llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF llReturn = (INLIST(_VFP.StartMode,1,2,3,5) OR ; (MESSAGEBOX(APP_READY_TO_SHUTDOWN_LOC, ; MB_YESNO+MB_ICONQUESTION, ; THIS.cCaption)= IDYES)) IF llReturn llReturn = THIS.ReleaseForms() ENDIF IF llInterrupted THIS.lNoInterrupt = .F. ENDIF ENDIF IF llReturn IF NOT tlCalledFromTopForm THIS.Release() QUIT ENDIF ENDIF RETURN llReturn ENDPROC PROCEDURE releaseforms LPARAMETERS tlForce LOCAL lnFormCount THIS.RefreshFormsCollection IF THIS.nFormCount = 0 RETURN ENDIF LOCAL loForm, loMemberForm, liResult, llInterrupted llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF FOR EACH loForm IN THIS.aForms IF VARTYPE(loForm) # "O" OR ; NOT INLIST("#"+UPPER(loForm.BaseClass)+"#","#FORMSET#","#FORM#") LOOP ENDIF IF tlForce THIS.DataRevert(.T.,.F.,loForm,.T.) ELSE IF NOT THIS.QueryDataSessionUnload(.F.,loForm) IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN .F. ENDIF ENDIF ENDFOR * only once they have confirmed all possible dataupdating/cancelling * out of the process can we begin to actually close forms. DO WHILE THIS.nFormCount>0 lnFormCount=THIS.nFormCount THIS.ReleaseForm(THIS.aForms[lnFormCount]) IF THIS.nFormCount=lnFormCount IF NOT tlForce IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN .F. ENDIF ENDIF ENDDO IF llInterrupted THIS.lNoInterrupt = .F. ENDIF ENDPROC PROCEDURE releaseform LPARAMETERS toForm THIS.ClearLastError() IF PCOUNT()=0 IF TYPE("_SCREEN.ActiveForm")= "O" _SCREEN.ActiveForm.Release() ENDIF ELSE IF VARTYPE(toForm)="O" toForm.Release() ENDIF ENDIF THIS.RefreshFormsCollection RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE resetformscollection THIS.nFormCount=0 DIMENSION THIS.aForms[1],THIS.aFormNames[1] THIS.aForms=.NULL. THIS.aFormNames="" ENDPROC PROCEDURE refreshformscollection LOCAL lnCount,lnCount2 THIS.ClearLastError() lnCount=1 DO WHILE lnCount<=THIS.nFormCount IF VARTYPE(THIS.aForms[lnCount])="O" lnCount=lnCount+1 LOOP ENDIF FOR lnCount2 = lnCount TO (THIS.nFormCount-1) THIS.aForms[lnCount2]=THIS.aForms[lnCount2+1] THIS.aForms[lnCount2+1]=.NULL. THIS.aFormNames[lnCount2]=THIS.aFormNames[lnCount2+1] THIS.aFormNames[lnCount2+1]="" ENDFOR THIS.nFormCount=THIS.nFormCount-1 IF THIS.nFormCount=0 EXIT ENDIF DIMENSION THIS.aForms[THIS.nFormCount],THIS.aFormNames[THIS.nFormCount] ENDDO IF THIS.nFormCount=0 THIS.ResetFormsCollection ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE refreshtoolbars IF THIS.lNoInterrupt * shouldn't happen RETURN ENDIF LOCAL loToolbar FOR EACH loToolbar IN THIS.aToolbars IF VARTYPE(loToolbar) = "O" loToolbar.Refresh ENDIF ENDFOR ENDPROC PROCEDURE dotoolbar LPARAMETERS tcClassLib, tcClass ASSERT EMPTY(tcClassLib) OR VARTYPE(tcClassLib) = "C" ASSERT EMPTY(tcClass) OR VARTYPE(tcClass) = "C" LOCAL lcClass, loToolbar, lcClassLib, ; liElement, liIndex, liToolbars, lcToolbarName IF EMPTY(tcClass) RETURN 0 ENDIF IF NOT EMPTY(tcClassLib) lcClassLib = tcClassLib ENDIF lcClass = UPPER(ALLTRIM(tcClass)) liElement = 0 liToolbars = ALEN(THIS.aToolbars,1) FOR liIndex = 1 TO liToolbars loToolbar = THIS.aToolbars[liIndex,1] * do we have a free element to fill? IF VARTYPE(loToolbar) # "O" OR ; VARTYPE(THIS.aToolbars[liIndex,2]) # "N" ; OR THIS.aToolbars[liIndex,2] = 0 liElement = liIndex LOOP ENDIF * is this toolbar already instantiated? IF UPPER(loToolbar.Class) == lcClass * increment its counter THIS.aToolbars[liIndex,2] = THIS.aToolbars[liIndex,2]+1 loToolbar.Show && position or dock here? RETURN liIndex ENDIF ENDFOR IF liElement = 0 IF VARTYPE(THIS.aToolbars[1,1]) = "O" liElement = liToolbars+1 ELSE liElement = 1 ENDIF DIMENSION THIS.aToolbars[liElement,2] ENDIF THIS.aToolbars[liElement,2] = 0 IF VARTYPE(THIS.oFrame) = "O" AND (NOT WONTOP(THIS.oFrame.Name)) THIS.oFrame.Show() ENDIF THIS.aToolbars[liElement,1]=THIS.Instantiate(lcClass,lcClassLib) IF VARTYPE(THIS.aToolbars[liElement,1]) = "O" IF PEMSTATUS(THIS.aToolbars[liElement,1], "oApp",5) THIS.aToolbars[liElement,1].oApp = THIS ENDIF THIS.aToolbars[liElement,2] = 1 THIS.aToolbars(liElement,1).Dock(THIS.iInitialToolbarPosition) * THIS.aToolbars[liElement,1].Show() replaced by: THIS.ActivateFormInFrame(THIS.aToolbars[liElement,1]) ENDIF RETURN liElement ENDPROC PROCEDURE releasetoolbar LPARAMETERS tiToolbarIndex, tlForce ASSERT VARTYPE(tiToolbarIndex) = "N" AND ; BETWEEN(tiToolbarIndex,1,ALEN(THIS.aToolbars,1)) ASSERT VARTYPE(tlForce) = "L" * this function expects an index from the toolbar array. * The second parameter normally comes from the * application releasing all toolbars by ReleaseToolbars() * or from some other manager releasing all forms of some * particular type, which represent all the "clients" of * this toolbar. In either case they would normally * use the tlForce parameter. * OTOH you pass can pass the index of the toolbar from * a single client of the toolbar, such as a form, * which would have kept a record of this reference when it * issued an app.dotoolbar() on its load. (DoToolbar returns * this index). WHen the form releases it wants * to notify the application that it doesn't need the toolbar * any more. The client form has no way of knowing * how many other clients may be using this toolbar, so tlForce * is not used. THIS.ClearLastError() IF PCOUNT()=0 OR EMPTY(tiToolbarIndex) RETURN .F. ENDIF LOCAL liCurrentToolbarRefCount IF VARTYPE(THIS.aToolbars[tiToolbarIndex,2]) # "N" liCurrentToobarRefCount = 0 ELSE liCurrentToolbarRefCount = THIS.aToolbars[tiToolbarIndex,2] ENDIF * toolbars don't have a RELEASE method by default, * and I don't want to assume any particular baseclass, * which is why I'm using the toolbar collection index * instead * release if this is the last reference to this * toolbar or if we are releasing all toolbars IF tlForce OR liCurrentToolbarRefCount <= 1 IF VARTYPE(THIS.aToolbars[tiToolbarIndex,1]) = "O" THIS.aToolbars[tiToolbarIndex,1].Release() ENDIF THIS.aToolbars[tiToolbarIndex,1] = .NULL. THIS.aToolbars[tiToolbarIndex,2] = 0 ELSE THIS.aToolbars[tiToolbarIndex,2] = liCurrentToolbarRefCount - 1 ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE releasetoolbars LPARAMETERS tlForce LOCAL liToolbar, liToolbarCount, llInterrupted THIS.ClearLastError() llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF liToolbarCount = ALEN(THIS.aToolbars,1) FOR liToolbar = 1 TO liToolbarCount IF VARTYPE(THIS.aToolbars[liToolbar,1]) = "O" AND ; NOT THIS.ReleaseToolbar(liToolbar, .T.) IF NOT tlForce IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN .F. ENDIF ENDIF ENDFOR THIS.oNavToolbar = .NULL. && can't hurt IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE releasecollaborators THIS.ClearLastError() LOCAL liMemberIndex, loMember FOR liMemberIndex = 1 TO ALEN(THIS.aCollaborators) loMember = THIS.aCollaborators[liMemberIndex] IF VARTYPE(loMember) = "O" IF TYPE("loMember.Parent") = "O" loMember.Parent.RemoveObject(loMember.Name) ELSE * otherwise it was just done with a CREATEOBJECT, IF PEMSTATUS(loMember,"Release",5) loMember.Release() ENDIF ENDIF ENDIF * the following should get rid of the object, if any: loMember = NULL THIS.aCollaborators[liMemberIndex] = NULL ENDFOR RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE createcollaborators *&* The collaborators mechanism allows for things that can't be *&* a member of the app container to disappear on cue, *&* like a background image on screen. *&* This abstract method gives you a hook to create collaborators *&* at startup (during the .Show() method), using AddCollaborator(), *&* but you can scope objects to the application *&* at any time during the life of the app. *&* AddCollaborator()'s params match Instantiate()'s. RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE instantiate LPARAMETERS tcClass, tcClassLib, tcClassContainerFileName, ; tcParamString, toParent, tcMemberName *&* new third param for IN support *&* will default to "" for ReadEvents, THIS.cClassContainerFileName *&* for non-ReadEvents... LOCAL loReturn, lcMemberName, lcClass, lcClassLib, lcContainer ASSERT VARTYPE(tcClass) = "C" AND (NOT EMPTY(tcClass)) ASSERT EMPTY(tcClassLib) OR VARTYPE(tcClassLib) = "C" ASSERT EMPTY(tcClassContainerFileName) OR ; (VARTYPE(tcClassContainerFileName) = "C" AND ; NOT EMPTY(SYS(2000,FULLPATH(tcClassContainerFileName)))) ASSERT EMPTY(tcParamString) OR VARTYPE(tcParamString) = "C" ASSERT VARTYPE(toParent) = "O" OR EMPTY(toParent) ASSERT EMPTY(tcMemberName) OR VARTYPE(tcMemberName) = "C" lcClass = ALLTRIM(tcClass) DO CASE CASE VARTYPE(tcClassLib) # "C" * default library is the app object's lcClassLib = THIS.ClassLibrary lcContainer = THIS.cClassContainerFileName CASE EMPTY(tcClassLib) * somebody has already SET CLASSLIB * and passed a null string to indicate this lcClassLib = "" lcContainer = "" OTHERWISE lcClassLib = ALLTRIM(tcClassLib) IF VARTYPE(tcClassContainerFileName) = "C" lcContainer = ALLTRIM(tcClassContainerFileName) ELSE IF EMPTY(SYS(2000,lcClassLib)) AND ; EMPTY(SYS(2000,lcClassLib+".VCX")) * not on disk, gotta find it somewhere... * like the product, we are assuming * that if the extension isn't used * it's a VCX, not a PRG/FXP lcContainer = THIS.cClassContainerFileName ELSE * found it! lcContainer = "" ENDIF ENDIF ENDCASE loReturn = .NULL. lcClassLib = THIS.GetResourceFileName(lcClassLib,".vcx .fxp .prg") IF NOT EMPTY(lcContainer) lcContainer = THIS.GetResourceFileName(lcContainer,".app .exe") ENDIF IF (EMPTY(lcClassLib) AND NOT EMPTY(tcClassLib)) OR ; (EMPTY(lcContainer) AND NOT EMPTY(tcClassContainerFileName)) RETURN .F. ENDIF IF VERSION(2) = 0 AND ; UPPER(JUSTEXT(lcClassLib)) == "PRG" IF NOT EMPTY(SYS(2000,lcClassLib)) * file is on disk for sure, and * we can't use it if it is built into * another file like this... lcContainer = "" COMPILE (lcClassLib) lcClassLib = FORCEEXT(lcClassLib,"FXP") ELSE RETURN .F. ENDIF ENDIF IF VARTYPE(toParent) = "O" IF VARTYPE(tcMemberName)= "C" lcMemberName = tcMemberName ELSE lcMemberName = "C"+SYS(2015) ENDIF ASSERT TYPE("toParent."+lcMemberName) # "O" ; MESSAGE toParent.&lcMemberName..Name + " "+APP_ALREADY_EXISTS_LOC+"." THIS.ClearLastError() IF EMPTY(tcParamString) toParent.NewObject(lcMemberName,lcClass,lcClassLib,lcContainer) ELSE toParent.NewObject(lcMemberName,lcClass,lcClassLib,lcContainer,&tcParamString.) ENDIF IF THIS.IsErrorFree() loReturn = EVAL("toParent."+lcMemberName) ENDIF ELSE IF EMPTY(tcParamString) loReturn = NEWOBJECT(lcClass,lcClassLib,lcContainer) ELSE loReturn = NEWOBJECT(lcClass,lcClassLib, lcContainer,&tcParamString.) ENDIF ENDIF RETURN loReturn ENDPROC PROCEDURE getcurrenttopformref RETURN THIS.cusWindowHandler.GetCurrentTopFormRef() ENDPROC PROCEDURE iserrorfree RETURN (ISNULL(THIS.iLastError)) ENDPROC PROCEDURE clearlasterror THIS.iLastError = .NULL. ENDPROC PROCEDURE getresourcefilename LPARAMETERS tcSourceFileName, tcExtensionList, tlSuppressMessage ASSERT VARTYPE(tcSourceFileName) = "C" AND NOT EMPTY(tcSourceFileName) ASSERT EMPTY(tcExtensionList) OR VARTYPE(tcExtensionList) = "C" * Try out any one of a number of extensions in a delimited * list if the filename-as-delivered is not found. * The "." characer is considered the delimiter for this * list, as it forms an integral part of the definition of a * file extension. * If *no* "." characters are found in the list but the list * is passed with a string containing spaces, then the * list will be assumed to be a list of space-delimited * extensions. * Filenames passed in a list will be tried in the order passed; * see THIS.DoProgram() for a potential list by precedence. * It's up to the calling program to figure out * what extensions are appropriate. LOCAL lcSourceFileName, lcTargetFileName, lcExtList, ; lcExt, liExts, liTryExt, liThisExtStarts,liNextExtStarts IF VARTYPE(tcSourceFileName) # "C" OR EMPTY(tcSourceFileName) RETURN "" ENDIF lcSourceFileName = ALLTR(tcSourceFileName) IF EMPTY(tcExtensionList) OR ("." $ tcSourceFileName) lcTargetFileName = LOWER(FULLPATH(lcSourceFileName)) IF NOT FILE(lcTargetFileName) lcTargetFileName = "" ENDIF ELSE lcExtList = ALLTRIM(tcExtensionList) liExts = OCCURS(".",lcExtList) IF liExts = 0 lcExtList = STRTRAN(tcExtensionList," ",".") ELSE lcExtList = STRTRAN(tcExtensionList," ","") ENDIF IF LEFT(lcExtList,1) # "." lcExtList = "."+lcExtList ENDIF liExts = OCCURS(".",lcExtList) FOR liTryExt = 1 TO liExts liThisExtStarts = AT(".",lcExtList,liTryExt) IF liTryExt # liExts liNextExtStarts = AT(".",lcExtList,liTryExt + 1) lcExt = SUBSTR(lcExtList,liThisExtStarts,liNextExtStarts-liThisExtStarts) ELSE lcExt = SUBSTR(lcExtList,liThisExtStarts) ENDIF lcTargetFileName = LOWER(FULLPATH(lcSourceFileName+lcExt)) IF FILE(lcTargetFileName) EXIT ELSE lcTargetFileName = "" ENDIF ENDFOR ENDIF IF EMPTY(lcTargetFileName) AND NOT tlSuppressMessage THIS.FileNotFoundMsgBox(tcSourceFileName) ENDIF RETURN lcTargetFileName ENDPROC PROCEDURE setenvironment THIS.ClearLastError() IF THIS.lReadEvents lcTemp = THIS.cReference+".OnShutdown()" ON SHUTDOWN &lcTemp lcTemp = THIS.cReference+".Error(ERROR(),PROGRAM(),LINENO())" ON ERROR &lcTemp IF VARTYPE(THIS.cMacKey) = "C" lcTemp = THIS.cMacKey SET MACKEY TO &lcTemp ELSE SET MACKEY TO ENDIF CLEAR MACROS ENDIF IF THIS.lNoScreenDuringApp THIS.SetScreenAttributes(.F.) * you always have the option to turn off _SCREEN, * in any type of app, although you should use * this ability sparingly if you are non-ReadEvents! * This ability is placed outside the CASE statement * below because the various permutations -- * readevents top form in a development environment, * ActiveDoc from which environment, even a special * type of server that you instantiate and "takes over" * temporary -- can't really be predicted. * Since original state will be restored at cleanup, * this isn't a risk, but the option is still .F. by * default because you should think before implementing * it . ENDIF DO CASE CASE VARTYPE(THIS.oFrame) = "O" THIS.SetFrameAttributes() CASE THIS.lReadEvents AND (NOT THIS.lNoScreenDuringApp) THIS.SetScreenAttributes(.T.) OTHERWISE * hands off! ENDCASE RETURN THIS.IsErrorFree() ENDPROC PROCEDURE donewopen LPARAMETERS tlNew LOCAL llReturn THIS.lAddingNewDocument = tlNew llReturn = THIS.DoDocumentPickerDialog(THIS.cNewOpenClass,; THIS.cNewOpenClassLib, ; tlNew) THIS.ResetToDefault("lAddingNewDocument") RETURN llReturn ENDPROC PROCEDURE displayerrorlog LOCAL loTemp, liIndex, llOK IF NOT EMPTY(THIS.cErrorViewerClass) loTemp = THIS.AddCollaborator(THIS.cErrorViewerClass,; THIS.cErrorViewerClassLib) IF VARTYPE(loTemp) = "O" llOK = loTemp.ApplyAppAttributes(THIS) IF llOK * maybe no error records, or even no table THIS.ActivateFormInFrame(loTemp) && modeless ELSE loTemp.Release() ENDIF ENDIF RETURN llOK ELSE THIS.cusError.DisplayErrorLog() ENDIF ENDPROC PROCEDURE beforedoform LPARAMETERS tcFileName,tcClass,tlNoMultipleInstances,tlNoShow, tlGoMenu, tlNavToolbar * abstract hook from DoForm ENDPROC PROCEDURE querydatasessionunload LPARAMETERS tlDataChangeAlreadyConfirmed, toSession ASSERT VARTYPE(tlDataChangeAlreadyConfirmed) = "L" ASSERT TYPE("toSession.DataSessionID") = "N" OR ; TYPE("_SCREEN.ActiveForm") = "O" LOCAL llDataHandled, loSession, llInterrupted llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF IF TYPE("toSession.DataSessionID") = "N" loSession = toSession ELSE loSession = _SCREEN.ActiveForm ENDIF IF tlDataChangeAlreadyConfirmed OR ; THIS.cusDataSession.DataChanged(loSession) llDataHandled = ; THIS.cusDataSession.QueryUnload(.t., loSession) ELSE llDataHandled = .T. ENDIF IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN llDataHandled ENDPROC PROCEDURE setappfilenames LOCAL lcSys16, liLevel lcSys16 = UPPER(SYS(16,0)) * get top-level filename, and also * get the name of the module (app or exe) that * owns this particular object, for SET CLASSLIB ... IN... * default usage, which may be different. * The latter is important to non-READ EVENTS apps. IF EMPTY(lcSys16) THIS.cAppFileName = "" ELSE THIS.cAppFileName = lcSys16 IF "PROCEDURE" $ THIS.cAppFileName THIS.cAppFileName = SUBSTR(THIS.cAppFileName,11) THIS.cAppFileName = SUBSTR(THIS.cAppFileName,1,AT(" ",THIS.cAppFileName)-1) ENDIF IF NOT FILE(THIS.cAppFileName) * this can happen if an "ON..." was involved... THIS.cAppFileName = "" ENDIF IF INLIST(RIGHT(THIS.cAppFileName,3),"VCT","DCT") * createobject from the command window, * or a stored procedure -- * a top-level SCX/FRX/LBX/MPR/QPR/SPR actually has a * chance at being used properly later, * but I don't think these two do! THIS.cAppFileName = "" ENDIF ENDIF * FOR liLevel = 256 TO 1 STEP -1 && 256 = twice the nested programs currently allowed! FOR liLevel = PROGRAM(-1) TO 1 STEP -1 lcSys16 = UPPER(SYS(16,liLevel)) IF INLIST(RIGHT(lcSys16,3),"APP","EXE","DLL") THIS.cClassContainerFileName = lcSys16 EXIT ENDIF ENDFOR RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE querydatachanged LPARAMETERS toSession, tiChangeMode LOCAL llReturn, llInterrupted llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF llReturn = THIS.cusDataSession.DataChanged(toSession,tiChangeMode) IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN llReturn ENDPROC PROCEDURE dataupdate LPARAMETERS tlUserChoiceAlreadyConfirmed, tlDataChangeAlreadyConfirmed, toSession, tlNoShow LOCAL llReturn, llInterrupted llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF llReturn = THIS.cusDataSession.Update(tlUserChoiceAlreadyConfirmed, tlDataChangeAlreadyConfirmed, toSession, tlNoShow) IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN llReturn ENDPROC PROCEDURE datarevert LPARAMETERS tlUserChoiceAlreadyConfirmed, tlDataChangeAlreadyConfirmed, toSession, tlNoShow LOCAL llInterrupted, llReturn llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF llReturn = THIS.cusDataSession.Revert(tlUserChoiceAlreadyConfirmed, tlDataChangeAlreadyConfirmed, toSession, tlNoShow) IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN llReturn ENDPROC PROCEDURE ccaption_access IF VARTYPE(THIS.cCaption) # "C" RETURN "" ELSE RETURN THIS.cCaption ENDIF ENDPROC PROCEDURE ccaption_assign LPARAMETERS tvNewVal IF VARTYPE(tvNewVal) # "C" THIS.cCaption = "" ELSE THIS.cCaption = tvNewVal ENDIF ENDPROC PROCEDURE cicon_assign LPARAMETERS m.vNewVal IF NOT EMPTY(m.vNewVal) THIS.cIcon = THIS.GetResourceFileName(m.vNewVal,".ico") ELSE THIS.cIcon = "" ENDIF ENDPROC PROCEDURE ilasterror_access RETURN THIS.ilasterror ENDPROC PROCEDURE cdatafolder_assign LPARAMETERS tcDataFolder LOCAL lcDataFolder lcDataFolder = IIF(VARTYPE(tcDataFolder) = "C" AND ; DIRECTORY(tcDataFolder), ; tcDataFolder,"") THIS.cDataFolder = lcDataFolder ENDPROC PROCEDURE creference_assign LPARAMETERS tcReference IF VARTYPE(tcReference) = "C" IF (TYPE(THIS.cReference+".Name") = "C" AND ; EVAL(THIS.cReference) = THIS) RELEASE (THIS.cReference) ENDIF THIS.cReference = tcReference ENDIF IF (NOT EMPTY(THIS.cReference)) AND ; (TYPE(THIS.cReference+".Name") # "C" OR ; EVAL(THIS.cReference) # THIS) RELEASE (THIS.cReference) PUBLIC (THIS.cReference) STORE THIS TO (THIS.cReference) ENDIF ENDPROC PROCEDURE cappfolder_access * note: this is an access method because * conceivably directories could get renamed * while an app is running! IF EMPTY(THIS.cAppFolder) OR (NOT DIRECTORY(THIS.cAppFolder)) LOCAL lcAppFolder IF (NOT EMPTY(THIS.cClassContainerFileName)) lcAppFolder = ; LEFT(THIS.cClassContainerFileName,RAT("\",THIS.cClassContainerFileName)) ENDIF * The cClassContainerFileName could be empty... it's possible * that this CREATEOBJECT was not done in an APP or EXE... * (see comments in SetAppFileNames() for how these properties are * used and what they represent) IF ( EMPTY(lcAppFolder) OR (NOT DIRECTORY(lcAppFolder)) ) ; AND ; (NOT EMPTY(THIS.cAppFileName)) lcAppFolder = LEFT(THIS.cAppFileName,RAT("\",THIS.cAppFileName)) * this will be a wrapper program -- may or may not * be the same for every user or every login, * especially if temp programs are involved, * so it is not as good as cClassContainerFileName ENDIF * finally, both the properties may be empty, especially if * an ON... was involved in the initial call, * We still need an appfolder **on disk** to give us * a default location for some system files IF ( EMPTY(lcAppFolder) OR (NOT DIRECTORY(lcAppFolder)) ) lcAppFolder = SET("DIRECTORY") ENDIF THIS.cAppFolder = lcAppFolder ENDIF IF RIGHT(THIS.cAppFolder,1) # "\" && for example, SET("DIRE") doesn't provide a final backslash! THIS.cAppFolder = THIS.cAppFolder + "\" ENDIF RETURN THIS.cAppFolder ENDPROC PROCEDURE lgomenu_assign LPARAMETERS tlGoMenuNeeded IF EMPTY(THIS.cGoMenuFile) RETURN .F. ENDIF DO CASE CASE tlGoMenuNeeded = THIS.lGoMenu * nothing to worry about CASE tlGoMenuNeeded THIS.lGoMenu = .T. IF TYPE([CNTBAR("_mGo")]) = "U" DO CASE CASE VARTYPE(THIS.oFrame) # "O" THIS.DoMenu(THIS.cGoMenuFile) CASE NOT EMPTY(THIS.oFrame.cMenuName) THIS.DoMenu(THIS.cGoMenuFile, .F.) OTHERWISE ENDCASE ELSE * already defined, just show the pad DO CASE CASE VARTYPE(THIS.oFrame) # "O" DEFINE PAD _msm_Go OF _MSYSMENU ; PROMPT APP_GO_PAD_LOC COLOR SCHEME 3 ; BEFORE _msm_windo ; KEY APP_GO_PAD_HOTKEY_LOC, [APP_GO_PAD_HOTKEY_LOC] ; MESSAGE APP_GO_MESSAGE_LOC ON PAD _msm_Go OF _MSYSMENU ACTIVATE POPUP _mgo CASE NOT EMPTY(THIS.oFrame.cMenuName) DEFINE PAD _msm_Go OF (THIS.oFrame.cMenuName); PROMPT APP_GO_PAD_LOC COLOR SCHEME 3 ; BEFORE _msm_windo ; KEY APP_GO_PAD_HOTKEY_LOC, [APP_GO_PAD_HOTKEY_LOC] ON PAD _msm_Go OF (THIS.oFrame.cMenuName) ACTIVATE POPUP _mgo OTHERWISE ENDCASE ENDIF OTHERWISE THIS.lGoMenu = .F. * for now, I am not putting menu shortcut keys on the * popup and I am just leaving it DEFINEd and inaccessible * for speed reasons -- so am not releasing it once defined DO CASE CASE VARTYPE(THIS.oFrame) # "O" RELEASE PAD _msm_Go OF _MSYSMENU * RELEASE POPUP _mGo EXTENDED CASE NOT EMPTY(THIS.oFrame.cMenuName) RELEASE PAD _msm_Go OF (THIS.oFrame.cMenuName) * RELEASE POPUP _mGo EXTENDED OTHERWISE ENDCASE ENDCASE RETURN ENDPROC PROCEDURE doreportdialog LPARAMETERS tlModify LOCAL llReturn llReturn = THIS.DoDocumentPickerDialog(THIS.cReportDialogClass,; THIS.cReportDialogClassLib, ; tlModify) RETURN llReturn ENDPROC PROCEDURE doaboutbox LOCAL llReturn llReturn = THIS.DoModalDialogClass(THIS.cAboutBoxClass, THIS.cAboutBoxClassLib) RETURN llReturn ENDPROC PROCEDURE dooptionsdialog LOCAL llOpenedTable, llReturn IF NOT USED(THIS.cUserTableAlias) USE (THIS.cUserTableName) IN 0 AGAIN SHARED ALIAS (THIS.cUserTableAlias) llOpenedTable = .T. ENDIF IF THIS.lUserPreferences THIS.SeekCurrentUser() ELSE THIS.SeekDefaultUser() ENDIF llReturn = THIS.DoModalDialogClass(THIS.cOptionsDialogClass, THIS.cOptionsDialogClassLib) IF llOpenedTable USE IN (THIS.cUserTableAlias) ENDIF RETURN llReturn ENDPROC PROCEDURE docontextmenu LPARAMETERS tcMenuFileName, tcPadName, tcPopupName LOCAL lcMenuFileName, ; liElement, liIndex, liMenus, lcMenu IF EMPTY(tcMenuFileName) OR EMPTY(tcPadName) OR EMPTY(tcPopupName) RETURN 0 ENDIF ASSERT VARTYPE(tcPadName) = "C" ASSERT VARTYPE(tcPopupName) = "C" ASSERT VARTYPE(tcMenuFileName) = "C" lcMenuFileName = THIS.GetResourceFileName(tcMenuFileName,".mpx .mpr") IF EMPTY(lcMenuFileName) RETURN 0 ENDIF liElement = 0 liMenus = ALEN(THIS.aContextMenus,1) FOR liIndex = 1 TO liMenus lcMenu = THIS.aContextMenus[liIndex,1] IF VARTYPE(lcMenu) # "C" OR ; VARTYPE(THIS.aContextMenus[liIndex,2]) # "N" ; OR THIS.aContextMenus[liIndex,2] = 0 liElement = liIndex LOOP ENDIF * is this menu already up? IF lcMenu == lcMenuFileName * increment its counter THIS.aContextMenus[liIndex,2] = THIS.aContextMenus[liIndex,2]+1 RETURN liIndex ENDIF ENDFOR IF liElement = 0 IF VARTYPE(THIS.aContextMenus[1,1]) = "C" liElement = liMenus+1 ELSE liElement = 1 ENDIF DIMENSION THIS.aContextMenus[liElement,4] ENDIF THIS.aContextMenus[liElement,1]=lcMenuFileName THIS.aContextMenus[liElement,2] = 1 THIS.aContextMenus[liElement,3] = ALLTRIM(tcPadName) THIS.aContextMenus[liElement,4] = ALLTRIM(tcPopupName) THIS.DoMenu(lcMenuFileName) && we don't want unique popup names for a context menu RETURN liElement ENDPROC PROCEDURE releasecontextmenu LPARAMETERS tiMenuIndex, tlForce ASSERT VARTYPE(tiMenuIndex) = "N" AND ; BETWEEN(tiMenuIndex,1,ALEN(THIS.aContextMenus,1)) ASSERT VARTYPE(tlForce) = "L" * this function expects an index from the context menu array. * see comments in the ReleaseToolbar method. THIS.ClearLastError() IF PCOUNT()=0 OR EMPTY(tiMenuIndex) RETURN .F. ENDIF LOCAL liCurrentMenuRefCount IF VARTYPE(THIS.aContextMenus[tiMenuIndex,2]) # "N" liCurrentMenuRefCount = 0 ELSE liCurrentMenuRefCount = THIS.aContextMenus[tiMenuIndex,2] ENDIF IF tlForce OR liCurrentMenuRefCount <= 1 IF VARTYPE(THIS.oFrame) # "O" RELEASE PAD (THIS.aContextMenus[tiMenuIndex,3]) OF _MSYSMENU ELSE RELEASE PAD (THIS.aContextMenus[tiMenuIndex,3]) OF (THIS.oFrame.cMenuName) ENDIF RELEASE POPUP (THIS.aContextMenus[tiMenuIndex,4]) EXTENDED STORE .F. TO THIS.aContextMenus[tiMenuIndex,1], ; THIS.aContextMenus[tiMenuIndex,2], ; THIS.aContextMenus[tiMenuIndex,3], ; THIS.aContextMenus[tiMenuIndex,4] ELSE THIS.aContextMenus[tiMenuIndex,2] = liCurrentMenuRefCount - 1 ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE dohelp LPARAMETERS tcFile LOCAL lcFileName, lcExt, llReturn llReturn = .T. THIS.ClearLastError() IF VARTYPE(tcFile) = "C" AND FILE(ALLTRIM(tcFile)) lcFileName = ALLTRIM(tcFile) ELSE lcFileName=ALLTRIM(THIS.cHelpFile) ENDIF IF EMPTY(lcFileName) RETURN .F. ENDIF lcFileName= THIS.GetResourceFileName(lcFileName,".hlp .dbf .htm .chm") IF EMPTY(lcFileName) RETURN .F. ENDIF lcExt = UPPER(JUSTEXT(lcFileName)) DO CASE CASE lcExt = "DBF" IF UPPER(lcFileName) # UPPER(SET("HELP",1)) LOCAL lcOldHelpFile, lcOldHelp lcOldHelp = SET("HELP") lcOldHelpFile = SET("HELP",1) SET HELP TO (lcFileName) SET HELP ON HELP IF NOT EMPTY(lcOldHelpFile) AND FILE(lcOldHelpFile) SET HELP TO (lcOldHelpFile) ENDIF SET HELP &lcOldHelp ELSE HELP ENDIF CASE INLIST(lcExt,"HLP","HTM","CHM") llReturn = THIS.DoFile(lcFilename) OTHERWISE * ?? ENDCASE RETURN llReturn AND (THIS.IsErrorFree()) ENDPROC PROCEDURE domodaldialogclass LPARAMETERS tcWhichDialogClass, tcWhichDialogClassLib, tlNoShow LOCAL loFormRef, lcWhichDialogClassLib IF EMPTY(tcWhichDialogClass) RETURN .F. ENDIF IF NOT EMPTY(tcWhichDialogClassLib) lcWhichDialogClassLib = tcWhichDialogClassLib ENDIF IF VARTYPE(THIS.oFrame) = "O" THIS.oFrame.Show() ENDIF loFormRef = THIS.Instantiate(tcWhichDialogClass,lcWhichDialogClassLib) IF VARTYPE(loFormRef) # "O" RETURN .F. ENDIF IF PEMSTATUS(loFormRef,"ApplyAppAttributes",5) loFormRef.ApplyAppAttributes(THIS) ELSE IF EMPTY(loFormRef.Icon) loFormRef.Icon = THIS.cIcon ENDIF ENDIF IF tlNoShow RETURN loFormRef ELSE loFormRef.WindowType = 1 THIS.ActivateFormInFrame(loFormRef) RETURN .T. ENDIF ENDPROC PROCEDURE cascadeform LPARAMETERS tcFormName LOCAL lcFormName DO CASE CASE (NOT EMPTY(tcFormName)) AND WEXIST(tcFormName) lcFormName = tcFormName CASE TYPE("_SCREEN.ActiveForm")= "O" lcFormName = _SCREEN.ActiveForm.Name OTHERWISE RETURN .F. ENDCASE ENDPROC PROCEDURE cascadeall LPARAMETERS tcForm THIS.cusWindowHandler.CascadeFormInstances(tcForm) ENDPROC PROCEDURE dosort LPARAMETERS tcField, tcAlias, tcTag, tlDescending THIS.cusTableSort.DoSort(tcField,tcAlias,tcTag,tlDescending) ENDPROC PROCEDURE gotop THIS.lNoInterrupt = .T. THIS.cusTableNav.GoTop() THIS.lNoInterrupt = .F. ENDPROC PROCEDURE gobottom THIS.lNoInterrupt = .T. THIS.cusTableNav.GoBottom() THIS.lNoInterrupt = .F. ENDPROC PROCEDURE gonext THIS.lNoInterrupt = .T. THIS.cusTableNav.GoNext() THIS.lNoInterrupt = .F. ENDPROC PROCEDURE goprevious THIS.lNoInterrupt = .T. THIS.cusTableNav.GoPrevious() THIS.lNoInterrupt = .F. ENDPROC PROCEDURE showtablegotodialog LOCAL llReturn llReturn = THIS.DoModalDialogClass("_GoTodialog", "_table.vcx") RETURN llReturn ENDPROC PROCEDURE showtablefinddialog LOCAL loForm, llInterrupted loForm = THIS.DoModalDialogClass("_FindDialog", "_table.vcx", .T.) IF VARTYPE(loForm) = "O" loForm.lAdvanced = THIS.lFindOnMultipleTables llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF loForm.Show(1) IF llInterrupted THIS.lNoInterrupt = .F. ENDIF ELSE RETURN .F. ENDIF ENDPROC PROCEDURE showtablesetfilterdialog LOCAL loForm THIS.cusTableNav.SetToActiveSession() loForm = THIS.DoModalDialogClass("_FilterExpr", "_table.vcx", .T.) IF VARTYPE(loForm) = "O" loForm.lAdvanced = THIS.lUse_GETEXPR loForm.Show(1) ELSE RETURN .F. ENDIF ENDPROC PROCEDURE releasecontextmenus LPARAMETERS tlForce LOCAL liMenu, liMenuCount THIS.ClearLastError() liMenuCount = ALEN(THIS.aContextMenus,1) FOR liMenu = 1 TO liMenuCount IF VARTYPE(THIS.aContextMenus[liMenu,1]) = "C" AND ; NOT THIS.ReleaseContextMenu(liMenu, .T.) IF NOT tlForce RETURN .F. ENDIF ENDIF ENDFOR RELEASE POPUP _mGo EXTENDED RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE setdatasessionenvironment LPARAMETERS tiSessionID LOCAL liSessionID liThisSessionID = SET("DATASESSION") IF VARTYPE(tiSessionID) = "N" SET DATASESSION TO (tiSessionID) ENDIF THIS.SetDataSessionSets() SET DATASESSION TO (liThisSessionID) ENDPROC PROCEDURE setdatasessionsets SET MULTILOCKS ON SET TALK OFF * .... ENDPROC PROCEDURE cimage_assign LPARAMETERS m.vNewVal *To do: Modify this routine for the Assign method IF NOT EMPTY(m.vNewVal) THIS.cimage = THIS.GetResourceFileName(m.vNewVal,".bmp .ico .gif") ELSE THIS.cImage = "" ENDIF ENDPROC PROCEDURE cerrorlogtablename_access LOCAL lcTable lcTable = THIS.cErrorLogTableName IF AT("\",lcTable) = 0 lcTable = THIS.cAppFolder+lcTable ENDIF IF AT(".",lcTable) = 0 lcTable = lcTable+".DBF" ENDIF RETURN lcTable ENDPROC PROCEDURE addcollaborator LPARAMETERS tcClass, tcClassLib,tcClassContainer, tcParamString, toParent, tcMemberName * should match Instantiate * Instantiate params: * LPARAMETERS tcClass, tcClassLib, tcClassContainer, tcParamString, toParent, tcMemberName * wrap Instantiate and puts the reference in the aCollaborators collection * so it can be properly managed * it's not really necessary to look out for usable empty array elements * in the middle of the array here -- objects may be released * during the life of the application, but the empty array elements will * not do any harm, so we * just re-DIME as necessary if the last element is in use... LOCAL liElement, lcClassLib liElement = ALEN(THIS.aCollaborators) IF VARTYPE(THIS.aCollaborators[liElement]) = "O" liElement = liElement + 1 DIME THIS.aCollaborators[liElement] ENDIF IF NOT EMPTY(tcClassLib) lcClassLib = tcClassLib * want to avoid passing a null string ENDIF THIS.aCollaborators[liElement] = ; THIS.Instantiate(tcClass, lcClassLib,tcClassContainer,tcParamString, toParent, tcMemberName) * Instantiate() will know to do a NEWOBJECT() or .NewObject() as required RETURN THIS.aCollaborators[liElement] ENDPROC PROCEDURE getformmediatorref LPARAMETERS toForm, tlForce IF VARTYPE(toForm) # "O" OR ; NOT (UPPER(toForm.BaseClass) == "FORM") RETURN NULL ENDIF LOCAL loMember, laCheck[1], loMediator, llExactSet loMediator = NULL llExactSet =(SET("EXACT") = "OFF") IF llExactSet SET EXACT ON ENDIF IF TYPE("toForm."+THIS.cFormMediatorName+".Name") = "C" loMediator = EVAL("toForm."+THIS.cFormMediatorName) IF ACLASS(laCheck,loMediator) = 0 OR ; ASCAN(laCheck,UPPER(APP_MEDIATOR_SUPERCLASS)) = 0 loMediator = NULL ENDIF ENDIF IF ISNULL(loMediator) AND toForm.ControlCount > 0 * try to find a member of the appropriate * class; slower than the above but still worthwhile * for generic dialogs that might not use the * appropriate mediator name for this app. FOR EACH loMember in toForm.Controls IF VARTYPE(loMember) = "O" ; AND ACLASS(laCheck,loMember) > 0 AND ; ASCAN(laCheck,UPPER(APP_MEDIATOR_SUPERCLASS)) > 0 loMediator = loMember EXIT ENDIF ENDFOR ENDIF IF ISNULL(loMediator) AND tlForce * create one loMediator = THIS.CreateFormMediator(toForm) ENDIF IF llExactSet SET EXACT OFF ENDIF RETURN loMediator ENDPROC PROCEDURE formisframeworkenabled LPARAMETERS toForm RETURN (NOT ISNULL(THIS.GetFormMediatorRef(toForm))) ENDPROC PROCEDURE createframe LOCAL lcClassLib THIS.ClearLastError() IF NOT EMPTY(THIS.cFrameClassLib) lcClassLib = THIS.cFrameClassLib ENDIF IF NOT EMPTY(THIS.cFrameClass) THIS.oFrame = THIS.Instantiate(THIS.cFrameClass,lcClassLib) IF VARTYPE(THIS.oFrame) = "O" THIS.oFrame.oApp = THIS ENDIF ELSE THIS.oFrame = .NULL. ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE releaseframe IF VARTYPE(THIS.oFrame) = "O" THIS.oFrame.oApp = .NULL. THIS.oFrame.Release() THIS.oFrame = .NULL. ENDIF ENDPROC PROCEDURE setscreenattributes LPARAMETERS tlOn LOCAL loTemp loTemp = THIS.AddCollaborator("_SysToolbars","_app",,".T.") loTemp = THIS.AddCollaborator("_ObjectState","_app",,"_SCREEN") IF VARTYPE(loTemp) = "O" IF tlOn IF NOT EMPTY(THIS.cCaption) loTemp.Set("Caption", THIS.cCaption, .T.) ENDIF loTemp.Set("Icon",THIS.cIcon, .T.) ENDIF loTemp.Set("Visible",tlOn,.T.) ELSE * this should never happen, but JIC, we'd * have a hard time debugging if we didn't do this! IF tlOn AND NOT _SCREEN.Visible _SCREEN.Visible = .T. ENDIF * notice I don't bother turning it off in the ! tlOn case. ENDIF ENDPROC PROCEDURE setframeattributes IF VARTYPE(THIS.oFrame) # "O" ** shouldn't happen RETURN ENDIF THIS.oFrame.BackColor = THIS.cusWindowHandler.iMDIWorkSpaceColor THIS.oFrame.Icon = THIS.cIcon THIS.oFrame.Caption = THIS.cCaption ENDPROC PROCEDURE showstartupelements LOCAL llSuccess THIS.lNoInterrupt = .T. IF VARTYPE(THIS.oFrame) = "O" THIS.oFrame.Show() ENDIF llSuccess = ; (EMPTY(THIS.cStartupToolbarClass) OR ; (NOT EMPTY(THIS.DoToolbar( THIS.cStartupToolbarClassLib,THIS.cStartupToolbarClass))) ) IF llSuccess AND (NOT EMPTY(THIS.cStartupMenu)) DO CASE CASE VARTYPE(THIS.oFrame) = "O" llSuccess = THIS.DoMenu(THIS.cStartupMenu, .T.) CASE THIS.lReadEvents llSuccess = THIS.DoMenu(THIS.cStartupMenu) OTHERWISE * append type IF EMPTY(THIS.cStartupMenuPad) llSuccess = THIS.DoMenu(THIS.cStartupMenu) * it's hard to believe that anybody is going to take over the * menu for a non-read-events app, but it could happen ELSE llSuccess = (NOT EMPTY(THIS.DoContextMenu(THIS.cStartupMenu, ; THIS.cStartupMenuPad, ; THIS.cStartupMenuPopup))) * this one returns a # so we can't do the exact same llSuccess check ENDIF ENDCASE ENDIF IF llSuccess IF (VARTYPE(THIS.oFrame) = "O") * if we closed screen during a topform-in-development-version * app, the frame is likely behind another Windows app at this point... THIS.oFrame.Show() ELSE SET MESSAGE TO && for neatness' sake ENDIF THIS.lNoInterrupt = .F. IF THIS.lStartupForm THIS.DoStartupForm() ENDIF ENDIF RETURN llSuccess ENDPROC PROCEDURE activatesystemwindow LPARAMETERs tcWindow IF EMPTY(tcWindow) OR _VFP.StartMode > 0 RETURN ENDIF LOCAL llAutoCenter llAutoCenter = _Screen.AutoCenter _SCREEN.AutoCenter = .T. _SCREEN.AutoCenter = llAutoCenter IF ! _SCREEN.Visible _SCREEN.Show() ENDIF IF WMIN("") ZOOM WINDOW SCREEN NORM ENDIF ACTIVATE WINDOW (tcWindow) IN SCREEN ENDPROC PROCEDURE domenuiteminframe LPARAMETERS tcToken IF EMPTY(tcToken) RETURN ENDIF THIS.cusWindowHandler.InvokeMenuItemInFrame(tcToken) ENDPROC PROCEDURE lnavtoolbar_assign LPARAMETERS tlNavToolbarNeeded IF EMPTY(THIS.cNavToolbarClass) RETURN .F. ENDIF DO CASE CASE tlNavToolbarNeeded = THIS.lNavToolbar THIS.lNavToolbar = tlNavToolbarNeeded * nothing to worry about CASE tlNavToolbarNeeded THIS.lNavToolbar = .T. IF VARTYPE(THIS.oNavToolbar) # "O" LOCAL liIndex liIndex = THIS.DoToolbar(THIS.cNavToolbarClassLib,THIS.cNavToolbarClass) THIS.oNavToolbar = THIS.aToolbars[liIndex,1] ELSE IF NOT THIS.oNavToolBar.Visible THIS.oNavToolbar.Show() ENDIF ENDIF OTHERWISE THIS.lNavToolbar = .F. IF (VARTYPE(THIS.oNavToolbar)= "O") AND THIS.oNavToolbar.Visible THIS.oNavToolbar.Hide() ENDIF ENDCASE RETURN ENDPROC PROCEDURE gotorecord LPARAMETERS tiRecord THIS.lNoInterrupt = .T. THIS.cusTableNav.GoToRecord(tiRecord) THIS.lNoInterrupt = .F. ENDPROC PROCEDURE getcurrentalias RETURN THIS.cusTableNav.GetCurrentAlias() ENDPROC PROCEDURE dotableoutput * this option looks at the current * form/alias for any form * if the form is enabled for * framework use, it can derive the * alias information with help of the * app mediator object LPARAMETERS tlOutputOneRecord LOCAL loDialog, loMediator, loActiveForm, liSession, lcAlias, ; lcCaption, lcScope, liRecno, llReturn, llInterrupted IF TYPE("_SCREEN.ActiveForm") = "O" loActiveForm = _SCREEN.ActiveForm loMediator = THIS.GetFormMediatorRef(loActiveForm) ENDIF liSession = SET("DATASESSION") DO CASE CASE TYPE("loActiveForm.Parent") = "O" SET DATASESSION TO (loActiveForm.Parent.DataSessionID) CASE VARTYPE(loActiveForm) = "O" SET DATASESSION TO (loActiveForm.DataSessionID) ENDCASE IF VARTYPE(loMediator) = "O" loMediator.PrepareOutputAlias() lcAlias = loMediator.cOutputAlias lcCaption = loMediator.cOutputCaption ENDIF IF EMPTY(lcAlias) lcAlias = ALIAS() ENDIF IF EMPTY(lcCaption) lcCaption = PROPER(lcAlias) ENDIF IF NOT ( EMPTY(lcAlias) OR EMPTY(RECCOUNT(lcAlias)) ) IF (NOT tlOutputOneRecord) llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. * we only have to worry about * this if we are * going to be using the * navigation features, which * may bring up a messagebox() ENDIF IF THIS.cusTableNav.CurrentTableAllowsNavigation(lcAlias) lcScope = "" ELSE lcScope = NULL ENDIF ELSE lcScope = "NEXT 1" ENDIF IF NOT ISNULL(lcScope) IF EOF(lcAlias) liRecno = 0 ELSE liRecno = RECNO(lcAlias) ENDIF ENDIF ENDIF IF (NOT ISNULL(lcScope)) AND ; VARTYPE(liRecno) = "N" AND ; (EMPTY(lcScope) OR liRecno # 0) IF NOT EMPTY(lcScope) lcCaption = lcCaption+"("+APP_OUTPUT_ONE_REC_LOC+")" ENDIF loDialog = THIS.DoModalDialogClass("_outputdialog","_reports", .T.) IF VARTYPE(loDialog) = "O" loDialog.cScope = lcScope loDialog.cAlias = lcAlias loDialog.Caption = loDialog.Caption + " " + lcCaption loDialog.lAddSourceNameToDropDown = .F. loDialog.cHTMLClass = THIS.SetHTMLClass(lcAlias,.T.) loDialog.cHTMLStyleID = THIS.SetHTMLStyleID(lcAlias, .T.) loDialog.Icon = THIS.cIcon loDialog.lPreventSourceChanges = .T. loDialog.cDisplayFontName = THIS.cTextDisplayFont loDialog.Show(1) loDialog = .NULL. llReturn = .T. ENDIF IF liRecno = 0 GO BOTTOM IN (lcAlias) SKIP IN (lcAlias) ELSE GO liRecno IN (lcAlias) ENDIF ENDIF IF VARTYPE(loMediator) = "O" loMediator.CleanupOutputAlias() ENDIF SET DATASESSION TO (liSession) IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN llReturn ENDPROC PROCEDURE cusertablename_access LOCAL lcTable lcTable = UPPER(THIS.cUserTableName) IF AT("\",lcTable) = 0 lcTable = THIS.cAppFolder+lcTable ENDIF IF AT(".",lcTable) = 0 lcTable = lcTable+".DBF" ENDIF IF EMPTY(SYS(2000,lcTable)) OR ; EMPTY(SYS(2000,STRTRAN(lcTable,".DBF",".FPT"))) THIS.CreateUserTable(lcTable) ENDIF RETURN lcTable ENDPROC PROCEDURE cusertablealias_assign LPARAMETERS tcNewVal IF VARTYPE(tcNewVal) # "C" OR ; (USED(tcNewVal) AND ; (NOT DBF(tcNewVal) == THIS.cUserTableName) ) THIS.cUserTableAlias = "U"+SYS(2015) ELSE THIS.cUserTableAlias = tcNewVal ENDIF ENDPROC PROCEDURE setcurrentuser LPARAMETERS tlChangeUser ASSERT VARTYPE(tlChangeUser) = "L" LOCAL llOpenedTable, llSuccess THIS.ClearLastError() IF NOT USED(THIS.cUserTableAlias) USE (THIS.cUserTableName) IN 0 AGAIN SHARED ALIAS (THIS.cUserTableAlias) IF NOT (THIS.IsErrorFree()) RETURN .F. ENDIF llOpenedTable = .T. ENDIF IF THIS.lUserPreferences IF EMPTY(THIS.cCurrentUser) OR tlChangeUser llSuccess = THIS.DoUserLogIn() ELSE llSuccess = THIS.SeekCurrentUser() ENDIF ELSE * we are using a global set of preferences * to cover all users THIS.SeekDefaultUser() llSuccess = .T. ENDIF IF llSuccess THIS.cCurrentUser = ; EVAL(THIS.cUserTableAlias+"."+THIS.cUserTableIDField) THIS.iCurrentUserLevel = ; EVAL(THIS.cUserTableAlias+"."+THIS.cUserTableLevelField) THIS.SetUserPermissions() && abstract in the base THIS.FillUserOptionsArray() THIS.ApplyGlobalUserOptions() THIS.SetCurrentUserFavoriteIDs(.NULL.) IF THIS.lReadEvents THIS.SetMacros() ENDIF ENDIF IF llOpenedTable USE IN (THIS.cUserTableAlias) ENDIF RETURN llSuccess ENDPROC PROCEDURE dostartupform LPARAMETERS tlAdd LOCAL llReturn, lcFavoriteIDs lcFavoriteIDs = THIS.cCurrentUserFavoriteIDs llReturn = THIS.DoDocumentPickerDialog(THIS.cStartupFormClass,; THIS.cStartupFormClassLib, ; tlAdd) IF tlAdd AND NOT (lcFavoriteIDs == THIS.cCurrentUserFavoriteIDs) * re-refresh the popup and save to disk * note: * modal form doesn't seem to be able to * affect the popup permanently -- the new bars "leave" * when the modal dialog's Destroy() fires! * That's why we don't do this earlier... THIS.SetCurrentUserFavoriteIDs(THIS.cCurrentUserFavoriteIDs) ENDIF RETURN llReturn ENDPROC PROCEDURE iinitialtoolbarposition_assign LPARAMETERS tiNewVal IF VARTYPE(tiNewVal) # "N" OR NOT INLIST(tiNewVal,-1,0,1,2,3) THIS.iInitialToolbarPosition = 0 ELSE THIS.iInitialToolbarPosition = tiNewVal ENDIF ENDPROC PROCEDURE caboutboxclass_access IF NOT THIS.lAboutBox RETURN "" ELSE RETURN THIS.cAboutBoxClass ENDIF ENDPROC PROCEDURE cstartupformclass_access RETURN THIS.cStartupFormClass ENDPROC PROCEDURE cstartuptoolbarclass_access IF NOT THIS.lStartupToolbar RETURN "" ELSE RETURN THIS.cStartupToolbarClass ENDIF ENDPROC PROCEDURE dodocumentpickerdialog LPARAMETERS tcClass,tcClassLib,tlAlternateMode IF EMPTY(tcClass) RETURN .F. ENDIF LOCAL loTemp, lcClassLib IF NOT EMPTY(tcClassLib) lcClassLib = tcClassLib ENDIF IF VARTYPE(THIS.oFrame) = "O" THIS.oFrame.Show() ENDIF loTemp = THIS.Instantiate(tcClass,; lcClassLib, ,; "THIS,"+IIF(tlAlternateMode,".T.",".F.")) IF VARTYPE(loTemp) = "O" IF PEMSTATUS(loTemp,"ApplyAppAttributes",5) loTemp.ApplyAppAttributes(THIS) ELSE IF EMPTY(loTemp.Icon) loTemp.Icon = THIS.cIcon ENDIF ENDIF loTemp.Show(1) ELSE RETURN .F. ENDIF ENDPROC PROCEDURE setuserpermissions * This method is abstract in the base, * meant to utilize iCurrentUserLevel property to maintain groups ENDPROC PROCEDURE seekcurrentuser LPARAMETERS tcName * This method is separated out so you can use different * user-location strategies (move the record pointer * differently) if you like. You will want to * change CreateUserTable() to match any changes you make here. * The application object expects that whatever table * you use, you will have created one c-type field and placed * its name in THIS.cUserTableIDField, and one i-type field and * placed its name in THIS.iUserTableLevelField. LOCAL llOpenedTable, llSuccess, lcName, llDeletedOff IF VARTYPE(tcName) = "C" lcName = tcName ELSE lcName = THIS.cCurrentUser ENDIF IF NOT USED(THIS.cUserTableAlias) * Note that ordinarily this method will be called with the * user table already opened but it might some time * be useful just to validate the current user USE (THIS.cUserTableName) IN 0 AGAIN SHARED ALIAS (THIS.cUserTableAlias) IF NOT (THIS.IsErrorFree()) RETURN .F. ENDIF llOpenedTable = .T. ENDIF * this is an exact but case-insensitive match IF SET("DELETED") = "OFF" llDeletedOff = .F. SET DELETED ON ENDIF IF THIS.lUserNameIsCaseSensitive llSuccess = SEEK(PADR(ALLTR((lcName)), ; LEN(EVAL(THIS.cUserTableAlias+"."+THIS.cUserTableIDField))), ; THIS.cUserTableAlias,"ID") ELSE llSuccess = SEEK(PADR(UPPER(ALLTR((lcName))), ; LEN(EVAL(THIS.cUserTableAlias+"."+THIS.cUserTableIDField))), ; THIS.cUserTableAlias,"ID_Upper") ENDIF IF llDeletedOff SET DELETED OFF ENDIF IF llOpenedTable USE IN (THIS.cUserTableAlias) ENDIF RETURN llSuccess ENDPROC PROCEDURE createusertable LPARAMETERS tcTable * is passed exact table name and location * is separated out so that you can * use different table structures more easily * The application object expects that whatever table * you use, you will have created one c-type field and placed * its name in THIS.cUserTableIDField, and one i-type field and * placed its name in THIS.cUserTableLevelField. THIS.ClearLastError() LOCAL liSelect, lcIDField, lcLevelField lcIDField = THIS.cUserTableIDField lcLevelField = THIS.cUserTableLevelField liSelect = SELECT() SELECT 0 CREATE TABLE (tcTable) ; ((lcIDField) C(60), ; (lcLevelField) I, ; UserPass M NOCPTRANS, ; UserOpts M NOCPTRANS, ; UserFave M NOCPTRANS, ; UserMacro M NOCPTRANS, ; UserNotes M ) INDEX ON PADR(ALLTR(&lcIDField.),60) TAG ID * create a case-sensitive, exact word match INDEX ON PADR(UPPER(ALLTR(&lcIDField.)),60) TAG ID_Upper * create a case-insensitive, exact word match INDEX ON DELETED() TAG IfDeleted USE SELECT (liSelect) RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE douserlogin ASSERT USED(THIS.cUserTableAlias) * we're supposed to be setting a record pointer * in an open table here... IF (NOT THIS.lUserPreferences) RETURN .F. ENDIF LOCAL loForm loForm = THIS.DoModalDialogClass(THIS.cUserLogInClass, THIS.cUserLogInClassLib, .T.) IF VARTYPE(loForm) = "O" loForm.Show(1) RETURN (NOT EOF(THIS.cUserTableAlias)) ELSE RETURN .F. ENDIF ENDPROC PROCEDURE filluseroptionsarray ASSERT USED(THIS.cUserTableAlias) IF TYPE(THIS.cUserTableAlias+".UserOpts") = "M" AND ; NOT EMPTY(EVAL(THIS.cUserTableAlias+".UserOpts")) RESTORE FROM MEMO (THIS.cUserTableAlias+".UserOpts") ADDITIVE * adds a local array, laOptions DIME THIS.aCurrentUserOpts[ALEN(laOptions,1),4] * array columns: property name, value, property or SET, datasession or global ACOPY(laOptions,THIS.aCurrentUserOpts) ENDIF ENDPROC PROCEDURE applyuseroptsforsession LPARAMETERS toSession IF VARTYPE(toSession) # "O" RETURN ENDIF LOCAL liSession, liRow, lcItem, lvValue, liPos, llInterrupted llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF liSession = SET("DATASESSION") SET DATASESSION TO (toSession.DataSessionID) FOR liRow = 1 TO ALEN(THIS.aCurrentUserOpts,1) IF THIS.aCurrentUserOpts[liRow,4] && global preference, not private to session LOOP ENDIF lcItem = THIS.aCurrentUserOpts[liRow,1] lvValue = THIS.aCurrentUserOpts[liRow,2] IF VARTYPE(lcItem) # "C" LOOP ENDIF IF NOT THIS.aCurrentUserOpts[liRow,3] && property of form or form member liPos = AT(".",lcItem) IF (liPos = 0 AND PEMSTATUS(toSession,lcItem,5)) OR ; (liPos > 1 AND PEMSTATUS(EVAL("toSession."+SUBSTR(lcItem,1,liPos-1)),SUBSTR(lcItem,liPos+1),5)) toSession.&lcItem. = lvValue ENDIF ELSE && SET value IF VARTYPE(lvValue) # "C" LOOP ENDIF SET &lcItem &lvValue ENDIF ENDFOR SET DATASESSION TO (liSession) IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN ENDPROC PROCEDURE seekdefaultuser * this is broken out in case * you want a different way of * assigning a "default user record" * than this one (blank user id field) LOCAL llOpenedTable IF NOT USED(THIS.cUserTableAlias) * see notes in SeekCurrentUser() USE (THIS.cUserTableName) IN 0 AGAIN SHARED ALIAS (THIS.cUserTableAlias) IF NOT (THIS.IsErrorFree()) RETURN .F. ENDIF llOpenedTable = .T. ENDIF IF RECCOUNT(THIS.cUserTableAlias) > 0 IF NOT THIS.SeekCurrentUser("") GO TOP IN (THIS.cUserTableAlias) ENDIF ELSE APPEND BLANK IN (THIS.cUserTableAlias) ENDIF IF llOpenedTable USE IN (THIS.cUserTableAlias) ENDIF ENDPROC PROCEDURE applyglobaluseroptions LOCAL liRow, lcItem, lvValue, liPos FOR liRow = 1 TO ALEN(THIS.aCurrentUserOpts,1) IF NOT THIS.aCurrentUserOpts[liRow,4] && datasession preference, not global LOOP ENDIF lcItem = THIS.aCurrentUserOpts[liRow,1] lvValue = THIS.aCurrentUserOpts[liRow,2] IF VARTYPE(lcItem) # "C" LOOP ENDIF IF NOT THIS.aCurrentUserOpts[liRow,3] && property of app or app member liPos = AT(".",lcItem) IF (liPos = 0 AND PEMSTATUS(THIS,lcItem,5)) OR ; (liPos > 1 AND PEMSTATUS(EVAL("THIS."+SUBSTR(lcItem,1,liPos-1)),SUBSTR(lcItem,liPos+1),5)) THIS.&lcItem. = lvValue ENDIF ELSE && SET value IF VARTYPE(lvValue) # "C" LOOP ENDIF SET &lcItem &lvValue ENDIF ENDFOR RETURN ENDPROC PROCEDURE getuseroptionsetting LPARAMETERS tcOption,taOptionArray IF VARTYPE(tcOption) # "C" RETURN .NULL. ENDIF IF PCOUNT() = 2 AND TYPE("taOptionArray[1,1]") # "C" RETURN .NULL. ENDIF LOCAL liElement, liRow, llExactSet LOCAL ARRAY laTemp[1] IF PCOUNT() = 2 ACOPY(taOptionArray,laTemp) ELSE ACOPY(THIS.aCurrentUserOpts,laTemp) ENDIF llExactSet = (SET("EXACT") = "OFF") IF llExactSet SET EXACT ON ENDIF liELEMENT = ASCAN(laTemp,tcOption) IF llExactSet SET EXACT OFF ENDIF IF NOT EMPTY(liElement) liRow = ASUBSCRIPT(laTemp,liElement,1) RETURN laTemp[liRow,2] ELSE RETURN .NULL. ENDIF ENDPROC PROCEDURE purgeerrorlog LOCAL lcTable, liSelect, lcAlias, llSafety lcTable = THIS.cErrorLogTableName IF EMPTY(lcTable) OR NOT FILE(lcTable) MESSAGEBOX(ERRORVIEWER_UNAVAILABLE_LOC,MB_ICONINFORMATION,THIS.cCaption) RETURN ENDIF THIS.ClearLastError() THIS.lSkipErrorHandling = .T. liSelect = SELECT() lcAlias = "E"+SYS(2015) USE (lcTable) ALIAS (lcAlias) EXCLUSIVE IN 0 THIS.lSkipErrorHandling = .F. IF (NOT THIS.IsErrorFree()) OR (NOT USED(lcAlias)) THIS.ClearLastError() MESSAGEBOX(ERRORVIEWER_IN_USE_LOC,MB_ICONSTOP,THIS.cCaption) IF USED(lcAlias) USE IN (lcAlias) ENDIF RETURN ENDIF IF NOT (RECCOUNT(lcAlias) = 0) llSafety = SET("SAFETY") = "OFF" IF llSafety SET SAFETY ON ENDIF SELECT (lcAlias) ZAP SELECT (liSelect) IF llSafety SET SAFETY OFF ENDIF ENDIF IF (RECCOUNT(lcAlias) = 0) MESSAGEBOX(ERRORVIEWER_EMPTY_LOC,MB_ICONINFORMATION,THIS.cCaption) ENDIF USE IN (lcAlias) RETURN ENDPROC PROCEDURE exporterrorlog LOCAL lcTable, liSelect, lcAlias, loDialog, lcTableAlias, llReturn lcTable = THIS.cErrorLogTableName IF EMPTY(lcTable) OR NOT FILE(lcTable) MESSAGEBOX(ERRORVIEWER_UNAVAILABLE_LOC,MB_ICONINFORMATION,THIS.cCaption) RETURN ENDIF THIS.ClearLastError() liSelect = SELECT() lcAlias = "ExportErrors" IF USED(lcAlias) lcAlias = "E"+SYS(2015) ENDIF SELE 0 USE (lcTable) AGAIN SHARED lcTableAlias = ALIAS() IF (NOT THIS.IsErrorFree()) THIS.ClearLastError() SELECT (liSelect) RETURN ENDIF SELECT errstamp, ; MLINE (listing,1)+" "+MLINE(listing,3) AS listing, ; MLINE(usernotes,1) AS usernotes ; FROM (lcTable) ; INTO CURSOR (lcAlias) SELECT (lcAlias) USE IN (lcTableAlias) IF _TALLY > 0 loDialog = THIS.DoModalDialogClass("_outputdialog","_reports", .T.) IF VARTYPE(loDialog) = "O" loDialog.Icon = THIS.cIcon loDialog.cAlias = lcAlias loDialog.lPreventSourceChanges = .T. loDialog.cDisplayFontName = THIS.cTextDisplayFont loDialog.cHTMLClass = THIS.SetHTMLClass(lcAlias,.T.) loDialog.cHTMLStyleID = THIS.SetHTMLStyleID(lcAlias,.T.) loDialog.Show(1) loDialog = .NULL. llReturn = .T. ENDIF ELSE MESSAGEBOX(ERRORVIEWER_EMPTY_LOC,MB_ICONINFORMATION,THIS.cCaption) ENDIF IF USED(lcAlias) USE IN (lcAlias) ENDIF SELECT (liSelect) RETURN llReturn ENDPROC PROCEDURE refreshfavoritepopup IF (NOT THIS.lFavorites) OR ; TYPE("CNTBAR(THIS.cFavoritePopupName)") # "N" RETURN .F. ENDIF LOCAL lcThisRef, lcStatement, lcFavoriteID, ; liBarNo, lcAlias, liSelect, laFavorites[1] lcThisRef = THIS.cReference * release all but top bars: FOR liBarNo = 4 TO CNTBAR(THIS.cFavoritePopupName) RELEASE BAR liBarNo OF (THIS.cFavoritePopupName) ENDFOR liBarNo = 3 * open metatable THIS.ClearLastError() IF NOT EMPTY(THIS.cMetaTable) lcAlias = "M"+SYS(2015) USE (THIS.cMetaTable) ALIAS (lcAlias) AGAIN SHARED IN 0 ENDIF IF NOT (THIS.IsErrorFree()) SET SKIP OF BAR 1 OF (THIS.cFavoritePopupName) .T. SET SKIP OF BAR 2 OF (THIS.cFavoritePopupName) .T. RETURN ENDIF liSelect = SELECT() IF NOT EMPTY(lcAlias) SELECT (lcAlias) ENDIF * now add rest of bars: IF NOT EMPTY(THIS.cCurrentUserFavoriteIDs) ALINES(laFavorites,THIS.cCurrentUserFavoriteIDs,.T.) STORE "" TO lcFavoriteID, lcStatement FOR EACH lcFavoriteID IN laFavorites IF NOT EMPTY(lcFavoriteID) lcFavoriteID = UPPER(ALLTR(lcFavoriteID)) lcStatement = "" IF FILE(lcFavoriteID) liBarNo = liBarNo + 1 DEFINE BAR liBarNo OF (THIS.cFavoritePopupName) ; PROMPT lcFavoriteID lcStatement = lcThisRef+"." lcStatement = lcStatement+"DoFile" lcStatement = lcStatement + "(["+lcFavoriteID+"])" ELSE IF NOT EMPTY(lcAlias) AND ; THIS.SeekMetaTableFavoriteID(lcFavoriteID,lcAlias) liBarNo = liBarNo + 1 DEFINE BAR liBarNo OF (THIS.cFavoritePopupName) ; PROMPT ALLTR(Doc_Descr) DO CASE CASE NOT EMPTY(Alt_Exec) lcStatement = ALLTRIM(Alt_Exec) CASE Doc_Wrap lcStatement = "DO (["+ ALLTRIM(Doc_Exec)+"])" CASE Doc_Type = PJX_META_DOC_REPORT_TYPE lcStatement = lcThisRef+".DoReport(["+; ALLTRIM(Doc_Exec)+"],["+ ; ALLTRIM(Doc_Descr)+"])" CASE Doc_Type = PJX_META_DOC_FORM_TYPE lcStatement = lcThisRef+".DoForm(["+ ; ALLTRIM(Doc_Exec)+"],["+ ; ALLTRIM(Doc_Class)+"],"+; IIF(Doc_Single,".T.,",".F.,")+; IIF(Doc_NoShow,".T.,",".F.,")+; IIF(Doc_Go,".T.,",".F.,")+; IIF(Doc_Nav,".T.",".F.")+")" OTHERWISE * ... ? ENDCASE ENDIF ENDIF IF NOT EMPTY(lcStatement) ON SELECTION BAR liBarNo OF ; (THIS.cFavoritePopupName) &lcStatement ENDIF ENDIF ENDFOR ENDIF * no possible docs? got all possible docs as favorites? didn't get any favorites? * the first two possibilities are no longer possible , since * we allow GETFILE() picking of favorites... * however it's still possible not to be able to clear any favorites * because there are none saved SET SKIP OF BAR 2 OF (THIS.cFavoritePopupName) (liBarNo = 3) IF NOT EMPTY(lcAlias) USE IN (lcAlias) ENDIF SELECT (liSelect) ENDPROC PROCEDURE ctextdisplayfont_assign LPARAMETERS tcNewVal IF VARTYPE(tcNewVal) # "C" OR EMPTY(tcNewVal) RETURN ENDIF LOCAL laTemp[1], lcVal, lcFont lcVal = ALLTR(tcNewVal) IF NOT EMPTY(AFONT(laTemp)) FOR EACH lcFont IN laTemp IF UPPER(lcVal) == UPPER(lcFont) THIS.cTextDisplayFont = lcVal EXIT ENDIF ENDFOR ENDIF ENDPROC PROCEDURE seekmetatablefavoriteid LPARAMETERS tcFavoriteID,tcAlias ASSERT USED(tcAlias) ASSERT TYPE("VAL(tcFavoriteID)") = "N" LOCAL liRecID * this is meant to be overridden if you have a better idea! * see the #DEFINE APP_META_FAVE_ID for what I'm using * here... liRecID = VAL(tcFavoriteID) IF liRecID > 0 AND liRecID <= RECCOUNT(tcAlias) GO liRecID IN (tcAlias) RETURN (NOT DELETED(tcAlias)) ELSE RETURN .F. ENDIF ENDPROC PROCEDURE setmacros LPARAMETERS tlSave IF VARTYPE(tlSave) # "L" OR (NOT THIS.lReadEvents) RETURN ENDIF LOCAL llOpenedTable, liBar, llSuccess THIS.ClearLastError() IF NOT USED(THIS.cUserTableAlias) USE (THIS.cUserTableName) ALIAS (THIS.cUserTableAlias) SHARED AGAIN IN 0 llOpenedTable = .T. ENDIF IF THIS.lUserPreferences THIS.SeekCurrentUser() ELSE THIS.SeekDefaultUser() ENDIF IF THIS.IsErrorFree() IF TYPE(THIS.cUserTableAlias+".UserMacro") = "M" DO CASE CASE tlSave SAVE MACROS TO MEMO (THIS.cUserTableAlias+".UserMacro") llSuccess = .T. CASE NOT EMPTY(EVAL(THIS.cUserTableAlias+".UserMacro")) llSuccess = .T. CLEAR MACROS RESTORE MACROS FROM MEMO (THIS.cUserTableAlias+".UserMacro") OTHERWISE CLEAR MACROS * can't restore from empty field ENDCASE ENDIF ENDIF IF llOpenedTable USE IN (THIS.cUserTableAlias) ENDIF IF TYPE("CNTBAR(THIS.cMacroPopupName)") = "N" FOR liBar = 1 TO CNTBAR(THIS.cMacroPopupName) IF UPPER(APP_MACRO_RESTORE_LOC) $ UPPER(BARPROMPT(liBar,THIS.cMacroPopupName)) SET SKIP OF BAR liBar OF (THIS.cMacroPopupName) (NOT llSuccess) EXIT ENDIF ENDFOR ENDIF ENDPROC PROCEDURE setcurrentuserfavoriteids LPARAMETERS tcNewVal LOCAL llOpenedTable, lcMetaTableLastUpdated, lcNewVal, ; laFavorites[1], liVal lcNewVal = "" THIS.ClearLastError() IF NOT USED(THIS.cUserTableAlias) USE (THIS.cUserTableName) ALIAS (THIS.cUserTableAlias) SHARED AGAIN IN 0 llOpenedTable = .T. ENDIF IF THIS.IsErrorFree() IF THIS.lUserPreferences THIS.SeekCurrentUser() ELSE THIS.SeekDefaultUser() ENDIF ENDIF IF THIS.IsErrorFree() IF VARTYPE(tcNewVal) # "C" * assignment to NULL while setting up a new user, * or for some other reason improperly initialized, so * refresh from the current or default record, * checking lupdate and lastrefresh first * set to "" if no good, with message IF TYPE(THIS.cUserTableAlias+".UserFave") = "M" AND ; NOT EMPTY(EVAL(THIS.cUserTableAlias+".UserFave")) IF (ALINES(laFavorites,EVAL(THIS.cUserTableAlias+".UserFave"),.T.) > 1) AND ; (TYPE(laFavorites[1])= "N") IF DTOS(LUPDATE(THIS.cUserTableAlias)) # laFavorites[1] * the meta table has been edited IF (MESSAGEBOX(APP_META_TABLE_CHANGED_LOC, ; MB_YESNO+MB_ICONEXCLAMATION, ; THIS.cCaption) = IDYES) REPLACE (THIS.cUserTableAlias+".UserFave") WITH "" ; IN (THIS.cUserTableAlias) ELSE * change the datestamp so they don't get asked again lcNewVal = EVAL(THIS.cUserTableAlias+".UserFave") lcNewVal = DTOS(LUPDATE(THIS.cUserTableAlias))+ ; SUBSTR(lcNewVal,AT(CHR(13),lcNewVal)) REPLACE (THIS.cUserTableAlias+".UserFave") WITH lcNewVal ; IN (THIS.cUserTableAlias) lcNewVal = "" ENDIF ENDIF IF NOT EMPTY(EVAL(THIS.cUserTableAlias+".UserFave")) FOR liVal = 2 TO ALEN(laFavorites) IF NOT EMPTY(laFavorites[liVal]) lcNewVal = lcNewVal + CHR(13)+laFavorites[liVal] ENDIF ENDFOR ENDIF ELSE MESSAGEBOX(APP_USER_FAVES_CORRUPT_LOC, ; MB_ICONSTOP, ; THIS.cCaption) REPLACE (THIS.cUserTableAlias+".UserFave") ; WITH "" IN (THIS.cUserTableAlias) ENDIF ENDIF ELSE * store the new string and the meta table lupdate, * back to the current user in the table, or clear the entry IF THIS.IsErrorFree() IF NOT EMPTY(tcNewVal) REPLACE (THIS.cUserTableAlias+".UserFave") ; WITH DTOS(LUPDATE(THIS.cUserTableAlias))+ ; tcNewVal ; IN (THIS.cUserTableAlias) lcNewVal = tcNewVal ELSE REPLACE (THIS.cUserTableAlias+".UserFave") ; WITH "" IN (THIS.cUserTableAlias) ENDIF ENDIF ENDIF ENDIF THIS.cCurrentUserFavoriteIDs = lcNewVal IF llOpenedTable USE IN (THIS.cUserTableAlias) ENDIF THIS.RefreshFavoritePopup() ENDPROC PROCEDURE dofile LPARAMETERS tcFile LOCAL lcFileName, liReturnValue, lcExt, lcStem, llReturn, llDevProduct THIS.ClearLastError() IF VARTYPE(tcFile) = "C" AND FILE(ALLTRIM(tcFile)) lcFileName = ALLTRIM(tcFile) ENDIF IF EMPTY(lcFileName) RETURN .F. ENDIF lcFileName= THIS.GetResourceFileName(lcFileName) IF EMPTY(lcFileName) RETURN .F. ENDIF lcExt = " "+UPPER(JUSTEXT(lcFileName))+" " IF NOT EMPTY(lcExt) AND LEN(lcExt) = 5 lcStem = FORCEEXT(lcFileName,"") ENDIF llReturn = NULL llDevProduct = (VERS(2) # 0) DO CASE CASE EMPTY(lcStem) * we didn't get anything we can use, * don't bother checking the CASEs CASE INLIST(lcExt," SCX ", " SCT ") llReturn = THIS.DoForm(lcStem) CASE INLIST(lcExt," LBX ", " LBT ") llReturn = THIS.DoLabel(lcStem) CASE INLIST(lcExt, " FRX ", " FRT ") llReturn = THIS.DoReport(lcStem) CASE lcExt == " MPX " llReturn = THIS.DoMenu(lcFileName) CASE INLIST(lcExt," MPR ", " MNX ", " MNT ") AND ; ( (llDevProduct AND FILE(FORCEEXT(lcFileName,"MPR"))) OR ; FILE(FORCEEXT(lcFileName,"MPX")) ) llReturn = THIS.DoMenu(lcStem) CASE INLIST(lcExt, " APP ", " FXP ") llReturn = THIS.DoProgram(lcFileName) CASE lcExt == " PRG " AND ; ( llDevProduct OR ; FILE(FORCEEXT(lcFileName,"FXP")) ) llReturn = THIS.DoProgram(lcStem) CASE INLIST(lcExt, " QPX ", " SPX ") * must use full filename for queries and sprs, * maintaining exact same behavior as the base product llReturn = THIS.DoProgram(lcFileName) CASE lcExt == " QPR " AND ; ( llDevProduct OR ; FILE(FORCEEXT(lcFileName,"QPX")) ) llReturn = THIS.DoProgram(FORCEEXT(lcFileName, "QPX")) CASE lcExt == " SPR " AND ; ( llDevProduct OR ; FILE(FORCEEXT(lcFileName,"SPX")) ) llReturn = THIS.DoProgram(FORCEEXT(lcFileName, "SPX")) OTHERWISE * fall through to below, unknown type file ENDCASE IF ISNULL(llReturn) DECLARE long ShellExecuteA IN SHELL32 ; long, string, string, string, string, long liReturnValue = ShellExecuteA( 0, "open", ; lcFilename, "","", 1 ) llReturn = (liReturnValue >= 32) ENDIF RETURN llReturn ENDPROC PROCEDURE clearfavorites * this is meant for interactive confirmation/menu use IF (MESSAGEBOX(APP_USER_FAVES_CLEAR_LOC, ; MB_ICONQUESTION + MB_YESNO, ; THIS.cCaption)) ; = IDYES THIS.SetCurrentUserFavoriteIDs("") ENDIF ENDPROC PROCEDURE storepassword LPARAMETERS tcValueToStore IF (NOT THIS.lUserPreferences) OR ; NOT USED(THIS.cUserTableAlias) OR ; VARTYPE(tcValueToStore) # "C" RETURN .F. ENDIF REPLACE UserPass WITH ; (THIS.CreateStoredPassword(tcValueToStore)) IN ; (THIS.cUserTableAlias) ENDPROC PROCEDURE createstoredpassword * separated out for easier editing, * created for Q&D checksum method of storing information, * but this is not really encryption... LPARAMETERS tcValueToStore ASSERT VARTYPE(tcValueToStore) = "C" RETURN SYS(2007,ALLTRIM(tcValueToStore)) ENDPROC PROCEDURE checkpassword LPARAMETERS tcValueToCheck ASSERT VARTYPE(tcValueToCheck) = "C" AND USED(THIS.cUserTableAlias) LOCAL lcValueToCheck, lcStoredPassword, llSuccess IF (NOT THIS.lUserPreferences) OR ; VARTYPE(tcValueToCheck) # "C" RETURN .F. ENDIF lcValueToCheck = ALLTRIM(tcValueToCheck) lcStoredPassword = EVAL("ALLTRIM("+THIS.cUserTableAlias+".UserPass)") llSuccess = THIS.CheckValueAgainstStoredPassword(lcValueToCheck, lcStoredPassword) RETURN llSuccess ENDPROC PROCEDURE checkvalueagainststoredpassword LPARAMETERS tcValueToCheck, tcStoredValue IF VARTYPE(tcValueToCheck) # "C" RETURN .F. ENDIF * see notes in _application.CreateStoredPassword()... * this method is separated out to make the method * of encryption more easily edited... RETURN (tcStoredValue == SYS(2007,tcValueToCheck)) ENDPROC PROCEDURE lusercanchangepassword_access *To do: Modify this routine for the Access method RETURN THIS.lusercanchangepassword ENDPROC PROCEDURE lusercanchangepassword_assign LPARAMETERS m.vNewVal *To do: Modify this routine for the Assign method THIS.lusercanchangepassword = m.vNewVal ENDPROC PROCEDURE dochangepassword IF (NOT THIS.lUserPreferences) * shouldn't even be in here RETURN .F. ENDIF IF NOT THIS.lUserCanChangePassword * this item may be on the menu * but not applicable to this user, * for various reasons MESSAGEBOX(USER_PERMISSION_DENIED_LOC,MB_ICONEXCLAMATION,THIS.cCaption) RETURN .F. ENDIF LOCAL llOpenedTable, llReturn IF NOT USED(THIS.cUserTableAlias) USE (THIS.cUserTableName) IN 0 AGAIN SHARED ALIAS (THIS.cUserTableAlias) llOpenedTable = .T. ENDIF THIS.SeekCurrentUser() llReturn = THIS.DoModalDialogClass(THIS.cChangePasswordClass, THIS.cChangePasswordClassLib) IF llOpenedTable USE IN (THIS.cUserTableAlias) ENDIF RETURN llReturn ENDPROC PROCEDURE handleprojectwindow LPARAMETERS tlShow IF VARTYPE(THIS.cProjectName) = "C" AND ; NOT EMPTY(THIS.cProjectName) AND ; WEXIST( APP_PM_WIN_TITLE_LOC +THIS.cProjectName) DO CASE CASE tlShow AND (NOT WVISIBLE( APP_PM_WIN_TITLE_LOC +THIS.cProjectName)) SHOW WINDOW ( APP_PM_WIN_TITLE_LOC +THIS.cProjectName) CASE tlShow * no problem OTHERWISE HIDE WINDOW ( APP_PM_WIN_TITLE_LOC +THIS.cProjectName) ENDCASE ELSE THIS.cProjectName = "" * prevent SHOWing it later * if we aren't responsible for HIDEing it * at this point, even if it does exist ENDIF ENDPROC PROCEDURE doformnoshow LPARAMETERS tcFileName,tcClass,tlNoMultipleInstances,tlGoMenu, tlNavToolbar LOCAL loForm, liCount THIS.RefreshFormsCollection() liCount = THIS.nFormCount loForm = .NULL. THIS.DoForm(tcFileName,tcClass,tlNoMultipleInstances,.T.,tlGoMenu, tlNavToolbar) IF THIS.nFormCount > liCount loForm = THIS.aForms(THIS.nFormCount) ENDIF RETURN loForm ENDPROC PROCEDURE sethtmlstyleid LPARAMETERS tcSource, tlTable ENDPROC PROCEDURE sethtmlclass LPARAMETERS tcSource, tlTable ENDPROC PROCEDURE activate THIS.ClearLastError() THIS.BeforeReadEvents() THIS.ReadEvents() RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE activateforminframe LPARAMETERS toFormRef LOCAL lcFormID, llToolbar IF UPPER(toFormRef.BaseClass) == "TOOLBAR" llToolbar = .T. ENDIF IF VARTYPE(THIS.oFrame) = "O" AND ; toFormRef.ShowWindow = 0 IF llToolBar lcFormID = toFormRef.Caption toFormRef.Caption = "." ELSE lcFormID = toFormRef.Name toFormRef.Name = "W"+SYS(2015) ENDIF ENDIF IF EMPTY(lcFormID) * ShowWindow is appropriate, no problem IF (NOT llToolBar) AND ; (toFormRef.WindowType = WINDOWTYPE_MODAL) toFormRef.Show(1) ELSE toFormRef.Show() ENDIF ELSE * fix the problem: IF llToolbar ACTIVATE WINDOW (toFormRef.Caption) ; IN WINDOW (THIS.oFrame.Name) toFormRef.Caption = lcFormID ELSE ACTIVATE WINDOW (toFormRef.Name) ; IN WINDOW (THIS.oFrame.Name) toFormRef.Name = lcFormID IF toFormRef.WindowType = WINDOWTYPE_MODAL toFormRef.Show(1) ENDIF ENDIF ENDIF ENDPROC PROCEDURE createformmediator LPARAMETERS toForm IF VARTYPE(toForm) # "O" OR ; NOT (UPPER(toForm.BaseClass) == "FORM") RETURN NULL ENDIF LOCAL lcMediatorName, loMediator IF TYPE("toForm."+THIS.cFormMediatorName+".Name") # "C" lcMediatorName = THIS.cFormMediatorName ELSE lcMediatorName = "Mediator_"+SYS(2015) * a mediator with a generated name * is less useful and will cause slower * behavior but it will do in a pinch ENDIF THIS.ClearLastError() loMediator = THIS.Instantiate(THIS.cMediatorClass,THIS.cMediatorClassLib,,,; toForm,lcMediatorName) IF (NOT THIS.IsErrorFree()) OR (NOT THIS.FormIsFrameworkEnabled(toForm)) THIS.ClearLastError() * required default classes THIS.cMediatorClass = "_FormMediator" THIS.cMediatorClassLib = "_FRAMEWK.VCX" loMediator = THIS.Instantiate(THIS.cMediatorClass,THIS.cMediatorClassLib,,,; toForm,lcMediatorName) ENDIF IF THIS.IsErrorFree() loMediator.cAppRef = THIS.cReference RETURN loMediator ELSE RETURN NULL ENDIF ENDPROC PROCEDURE validatemetatable LPARAMETERS tcTable, tlOmitFeedback IF EMPTY(tcTable) AND EMPTY(THIS.cMetaTable) RETURN .T. ENDIF LOCAL lcTable, lcMessage, lcAlias, liSelect, ; llReturn, liTagCount ,laRequired[1], laKeys[1], ; liFound, llExactOff lcAlias = "M"+SYS(2015) THIS.ClearLastError() IF EMPTY(tcTable) USE (THIS.cMetaTable) ALIAS (lcAlias) EXCLU IN 0 lcTable = THIS.cMetaTable ELSE USE (tcTable) ALIAS (lcAlias) EXCLU IN 0 lcTable = tcTable ENDIF llReturn = THIS.IsErrorFree() AND USED(lcAlias) IF NOT llReturn lcMessage = APP_META_UNAVAILABLE_LOC+; CHR(13) + CHR(13)+ ; lcTable ENDIF IF llReturn llReturn = ; TYPE(lcAlias+".DOC_TYPE") = "C" AND ; TYPE(lcAlias+".DOC_DESCR") = "C" AND ; TYPE(lcAlias+".DOC_EXEC") = "M" AND ; TYPE(lcAlias+".DOC_CLASS") = "M" AND ; TYPE(lcAlias+".DOC_NEW") = "L" AND ; TYPE(lcAlias+".DOC_OPEN") = "L" AND ; TYPE(lcAlias+".DOC_SINGLE") = "L" AND ; TYPE(lcAlias+".DOC_NOSHOW") = "L" AND ; TYPE(lcAlias+".DOC_WRAP") = "L" AND ; TYPE(lcAlias+".DOC_GO") = "L" AND ; TYPE(lcAlias+".DOC_NAV") = "L" AND ; TYPE(lcAlias+".ALT_EXEC") = "M" * the last two fields in the delivered metatable * are non-required fields IF NOT llReturn lcMessage = APP_META_WRONGFORMAT_LOC + ; CHR(13)+CHR(13)+ ; lcTable ENDIF ENDIF IF llReturn IF (SET("EXACT") = "OFF") SET EXACT ON llExactOff = .T. ENDIF liSelect = SELECT() SELECT (lcAlias) * check for required tags... DIME laRequired[5] laRequired[1] = "DOC_OPEN" laRequired[2] = "DOC_NEW" laRequired[3] = "DOC_DESCR" laRequired[4] = "DOC_TYPE" laRequired[5] = "DELETED()" DIME laKeys[TAGCOUNT()] FOR liTagCount = 1 TO TAGCOUNT() laKeys[liTagCount] = UPPER(KEY(liTagCount)) ENDFOR FOR liTagCount = 1 TO ALEN(laRequired) liFound = ASCAN(laKeys,UPPER(laRequired[liTagCount])) IF liFound = 0 llReturn = .F. EXIT ENDIF ENDFOR IF NOT llReturn lcMessage = APP_META_MISSINGINDEX_LOC + CHR(13) + ; laRequired[1]+ CHR(13)+ ; laRequired[2]+ CHR(13)+ ; laRequired[3]+ CHR(13) + ; laRequired[4]+ CHR(13) + ; laRequired[5] ENDIF IF llExactOff SET EXACT OFF ENDIF SELECT (liSelect) ENDIF IF NOT (llReturn OR tlOmitFeedback) IF INLIST(_VFP.Startmode, 0, 4) MESSAGEBOX(lcMessage,MB_ICONSTOP,THIS.cCaption) ELSE THIS.cusError.RecordServerError(; THIS.cCaption+": "+lcMessage) ENDIF ENDIF IF USED(lcAlias) USE IN (lcAlias) ENDIF RETURN llReturn ENDPROC PROCEDURE addmediatedsession * Creates a data session with a mediator object attached, * referenced in the aCollaborators collection, * returns a reference to this framework-enabled session. LOCAL loSession, lcPass THIS.cSessionClassLib = THIS.GetResourceFileName(THIS.cSessionClassLib,".fxp .prg") IF EMPTY(THIS.cSessionClass) OR EMPTY(THIS.cSessionClassLib) lcPass = ".T." ELSE lcPass = ".T.,["+THIS.cSessionClass+"],["+THIS.cSessionClassLib+"]" ENDIF loSession = THIS.AddCollaborator(THIS.cMediatedSessionClass, THIS.cMediatedSessionClassLib,,lcPass) IF NOT ISNULL(loSession) loSession.LoadApp(THIS.cReference) * save class def information, which * may in some instances be generated, * for other members, so it doesn't need to be * re-generated each time IF EMPTY(THIS.cSessionClass) AND NOT EMPTY(loSession.cSessionClass) THIS.cSessionClass = loSession.cSessionClass ENDIF IF EMPTY(THIS.cSessionClassLib) AND NOT EMPTY(loSession.cSessionClassLib) THIS.cSessionClassLib = loSession.cSessionClassLib ENDIF ENDIF RETURN loSession ENDPROC PROCEDURE releasesessions LPARAMETERS tlForce LOCAL loCollaborator, liMemberIndex, llInterrupted llInterrupted = (NOT THIS.lNoInterrupt) IF llInterrupted THIS.lNoInterrupt = .T. ENDIF FOR EACH loCollaborator IN THIS.aCollaborators IF VARTYPE(loCollaborator) # "O" ; OR NOT PEMSTATUS(loCollaborator,"DataSessionID",5) LOOP ENDIF IF tlForce THIS.DataRevert(.T.,.F.,loCollaborator) ELSE DO CASE CASE THIS.iQueryUnloadResultForNonVisualSessions = 0 THIS.DataRevert(.T.,.F.,loCollaborator) CASE THIS.iQueryUnloadResultForNonVisualSessions = 1 THIS.DataUpdate(.T.,.F.,loCollaborator) OTHERWISE IF NOT THIS.QueryDataSessionUnload(.F.,loCollaborator) IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN .F. ENDIF ENDCASE ENDIF ENDFOR * only once they have confirmed all possible dataupdating/cancelling * out of the process do we begin to actually close sessions, just as with forms FOR liMemberIndex = 1 TO ALEN(THIS.aCollaborators) loCollaborator = THIS.aCollaborators[liMemberIndex] IF VARTYPE(loCollaborator) # "O" ; OR NOT PEMSTATUS(loCollaborator,"DataSessionID",5) LOOP ENDIF IF TYPE("loCollaborator.Parent") = "O" loCollaborator.Parent.RemoveObject(loCollaborator.Name) ELSE IF PEMSTATUS(loCollaborator,"Release",5) loCollaborator.Release() ENDIF ENDIF loCollaborator = NULL THIS.aCollaborators[liMemberIndex] = NULL ENDFOR IF llInterrupted THIS.lNoInterrupt = .F. ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE lnointerrupt_assign LPARAMETERS tvNewVal IF VARTYPE(tvNewVal) = "L" AND ; tvNewVal # THIS.lNoInterrupt WITH THIS.tmrRefresh IF tvNewVal .Interval = 0 ELSE .Interval = .iRegularInterval ENDIF ENDWITH THIS.lNoInterrupt = tvNewVal ENDIF ENDPROC PROCEDURE Init IF NOT DODEFAULT() RETURN .F. ENDIF THIS.cIcon = THIS.GetResourceFileName(THIS.cIcon, ".ico", .T.) THIS.cImage = THIS.GetResourceFileName(THIS.cImage, ".bmp .ico .gif", .T.) IF VARTYPE(THIS.cReference) = "C" AND (NOT EMPTY(THIS.cReference)) THIS.cReference = THIS.cReference ENDIF IF NOT THIS.SetAppFileNames() RETURN .F. ENDIF IF VERSION(2) = 0 AND _VFP.StartMode = 4 AND ; UPPER(THIS.cClassContainerFileName) == UPPER(THIS.cAppFileName) * if the running EXE is this file, and this file * is not set up to be Read Events, make it Read Events anyway. THIS.lReadEvents = .T. ENDIF RETURN (THIS.IsErrorFree()) ENDPROC PROCEDURE Destroy DODEFAULT() THIS.lNoInterrupt = .T. * one last disable the timer so we can avoid it * interfering while we're closing up shop. IF EMPTY(THIS.cFrameClass) AND (NOT EMPTY(THIS.cGoMenuFile)) RELEASE PAD _msm_Go OF _MSYSMENU RELEASE POPUP _mGo EXTENDED ENDIF * some of this is double-handling but * will not hurt -- it's possible * that a CLEAR ALL or other mechanism * has ended the app without a Release() * method having been issued -- such * as a failed Show method: THIS.ReleaseContextMenus(.T.) THIS.ReleaseSessions(.T.) THIS.ReleaseForms(.T.) THIS.ReleaseToolbars(.T.) THIS.ReleaseCollaborators() THIS.ReleaseFrame() THIS.ClearEvents() IF USED(THIS.cUserTableAlias) USE IN (THIS.cUserTableAlias) ENDIF IF NOT THIS.lRestoredEnvironment * must restore environment * at all times, because * failure may have occurred * during Show, but * have to make sure *not* * to restore environment * if it's already been done * because there are things * in here than cannot or * should not be done twice: THIS.RestoreEnvironment() ENDIF IF NOT EMPTY(THIS.cReference) RELEASE (THIS.cReference) ENDIF THIS.HandleProjectWindow(.T.) ENDPROC PROCEDURE release LPARAMETERS tlForce IF NOT THIS.ReleaseSessions(tlForce) RETURN .F. ENDIF IF NOT THIS.ReleaseForms(tlForce) RETURN .F. ENDIF THIS.lNoInterrupt = .T. THIS.ReleaseContextMenus(tlForce) THIS.ReleaseToolbars(tlForce) THIS.ReleaseCollaborators() THIS.ReleaseFrame() THIS.ClearEvents() RELEASE THIS ENDPROC PROCEDURE Error LPARAMETERS nError, cMethod, nLine THIS.iLastError = nError IF THIS.lSkipErrorHandling * special cases -- right * now this is done when * trying to USE the error log EXCLUSIVEly * for purging RETURN ENDIF THIS.cusError.Handle(nError,cMethod,nLine) LOCAL llFatal, llUserCancelled, lcCaller, lcProg, ; llNoCodeExecuting, liLevel, lcTemp llFatal = THIS.cusError.IsFatal() llUserCancelled = THIS.cusError.UserCancelled() IF NOT (llFatal OR llUserCancelled) liLevel = 0 lcCaller = "" lcProg = PROGRAM(0) DO WHILE .T. lcCaller = PROGRAM(liLevel) liLevel = liLevel + 1 lcProg = PROGRAM(liLevel) IF EMPTY(lcProg) OR (UPPER(lcProg) == UPPER(THIS.Name+".ERROR")) EXIT ENDIF ENDDO llNoCodeExecuting = (UPPER(lcCaller) == UPPER(THIS.Name+".READEVENTS")) ENDIF DO CASE CASE THIS.iLastError # nError * an error in the error handler! * this will have been taken care of * and we don't want to get * into a recursive situation CASE llFatal OR llUserCancelled IF THIS.lReadEvents lcTemp = THIS.cLastOnError ON ERROR &lcTemp * remove reference to App Object * in error handler *now* before * it can start messing about with * destroying itself ENDIF THIS.Release() CASE llNoCodeExecuting RETRY OTHERWISE RETURN ENDCASE ENDPROC  Ym%AU@ CT%C 9<UTHISOAPP CMENUNAME %COTCa %~TTT C Ta%  BULOTEMPLLRETURNTHISOAPP ONSHUTDOWNOFRAMERELEASE; %C%TMC]4B-UTHIS CMENUNAMEDestroy, QueryUnloadLoad11A6RBBBB3qA3) D-) %W!U$%CimgApplicationh!%C  C0 lTaTT-(%ClblApplicationNamehT %C lblCreditshT &TC  &TC  &TC  &TC  UTHISCIMAGEIMGAPPLICATIONVISIBLEPICTURELBLAPPLICATIONNAMECAPTIONCCAPTION LBLCREDITSCAUTHORCCOMPANY CCOPYRIGHT CTRADEMARKCVERSION%C#TAbout C_TC_TC_TC_TC_TC_TC_T C _ C U TOAPPTHISCAPTIONCCAPTIONCVERSION CCOPYRIGHTCCOMPANYCAUTHOR CTRADEMARKCIMAGEAPPLYATTRIBUTESTODIALOGELEMENTSapplyattributestodialogelements,applyappattributesl1AaAAaAbddddB4q3QQQQQQQC3+S|y()  %ShbU CUTHISFORMRELEASEClick,11#) H / / 0 %V TUT%}5C Attempts to log in exceed limit!x C CUTHISITRIES ITRIESALLOWEDCAPTION FAILLOGINRELEASEMT-%C:L%C!Would you like to add a new user?4User not listed.x6TC'rTazC'Store a new password for this user now.C C .This new user will receive basic-level access. x BU LCNAMETHIS LADDINGUSER OKTOADDUSERTXTNAMEVALUEOAPPCUSERTABLEALIASCUSERTABLEIDFIELDCAPTION BaU/CCCUTCVALUETOSTORETHISOAPP STOREPASSWORDBCUTCVALUETOCHECKTHISOAPP CHECKPASSWORDC%CN<#6HUTHISOAPPCUSERTABLEALIAS%% %VCC%CC 6R,C!Incorrect password for this user.=C  C U THIS RELEASETYPE LVALIDUSERLVALIDPASSWORD LADDINGUSERSTORENEWPASSWORDINFO TXTPASSWORDVALUECHECKPASSWORDINFOSETFOCUS FAILLOGINNTC %(%%CC C \ T-$&T  User Login%C %CT T aT -T -T -T % G C UTOAPP LLSUCCESSCUSERTABLEALIASTHISCAPTIONCCAPTION CCURRENTUSERSEEKCURRENTUSERTXTNAMEVALUE LVALIDUSERLVALIDPASSWORDOAPPRELEASETUTHISOAPP= %6 C CUNKEYCODE NSHIFTALTCTRLTHIS FAILLOGINRELEASEincrementfailedattempts, addusernow oktoadduserstorenewpasswordinfocheckpasswordinfo faillogind QueryUnloadapplyappattributesGDestroy/KeyPressP1qqQA2rQsBA6v2qB4qR3!A4AaAAAAA2qqQa1aAAAAA22A2#$ F#:+!3A 9"+C2@ TL oN r)/  %@OU`T-%C9T-BTC% vTCT% %CBELLvONC %R,CUser not listed.= C *%   C   P%CC  L C  BU LLSUCCESSTHISFORMLVALIDPASSWORDTHISVALUE LVALIDUSEROAPPSEEKCURRENTUSER ADDUSERNOWINCREMENTFAILEDATTEMPTS LADDINGUSER TXTPASSWORDCHECKPASSWORDINFORELEASEValid,1q!AABAQAAA1)9    % UC+  TC%xCT-T a Ta H TC T 2T - % C %CBELLvON!C % 6R,C!Incorrect password for this user.= C %C BUTHISFORMOAPPCUSERTABLEALIAS LLSUCCESS LCPASSWORDTHISVALUE LADDINGUSERSTORENEWPASSWORDINFO LVALIDUSERCHECKPASSWORDINFOLVALIDPASSWORDRELEASEINCREMENTFAILEDATTEMPTSValid,11"AQAAfAAA4G) q XXK%2Us TCt %C] % CC pT  % CC T  % CC T  % CC  T  % CC @T  % CC tT % CC TTC%C.T.bmpTC%C0ITaTbT-%C TC _TC _(TC C _(TC C _(TC C_(TC C _TlB-U TCCAPTION TCVERSIONTCAUTHOR TCCOMPANY TCCOPYRIGHT TCTRADEMARKTCIMAGELIPCOUNTTHISCCAPTIONCVERSIONCAUTHORCCOMPANY CCOPYRIGHT CTRADEMARKCIMAGEIMGAPPLICATIONVISIBLEPICTURELBLAPPLICATIONNAMECAPTION LBLCREDITSTITLEBARInit,1rAAAAAAARAQ2aA2ArB2<)XX ??H%/.zU%CO%CMT %CvT CCB-U TOAPPTHISCAPTIONCCAPTIONICONCICONADJUSTFORSYSTEMFONTSIZEAPPLYUSEROPTSFORSESSION DATASESSIONID~ %C MS Sans Serif$ !C MS Sans Serif$ !C MS Sans Serif$ !C MS Sans Serif$  wTC MS Sans Seriffs Ho. CFontNameh Cf TArial( CloControl.Buttons(1)bOg CFontNameArial2oULCSTANDARDFONT LOCONTROLTHISCONTROLSFONTNAMESETALL CG2% 93%   Ta CT  ! %B-U THIS LSINGLETONLOFORMLLFOUNDFORMS CLASSLIBRARYCLASSVISIBLESHOW AUTOCENTERapplyappattributes,adjustforsystemfontsizeNLoad 1qR!A!1A1qA4e #ROBB4a31AAAqAA3iA)? k%PU!%CCCC:C%Your new password has been accepted. xJCX(UTHISTXTCONFIRMPASSWORDVALUE TXTPASSWORDOAPP STOREPASSWORDCAPTIONTC %%Cy+T Change PasswordT T-% C   CU TOAPP LLSUCCESSCUSERTABLEALIASTHISCAPTIONCCAPTIONOAPP ISERRORFREERELEASE CTUTHISOAPP0 %) CUNKEYCODE NSHIFTALTCTRLTHISRELEASE savepassword,applyappattributesDestroy9KeyPressc1A4qq!AAA32A37` t) s{%U(%TCCUTHISFORMCMDOKENABLEDTXTCONFIRMPASSWORDVALUETHISInteractiveChange,1Q1y) r%U(%TCCUTHISFORMCMDOKENABLED TXTPASSWORDVALUETHISInteractiveChange,1Q1r) 94%n}U C CUTHISFORM SAVEPASSWORDRELEASEClick,11<)  %ShbU CUTHISFORMRELEASEClick,12%) mms%j-U %C (B- %d+TChoose a document to create)TChoose a document to openUTOAPPTLNEWTHISCAPTION0T%C-B H>) CC  TCC &lcStatement  CCC2)hCCCCCCCCCU LIROWTHISFORM LSTDOCUMENTSVALUETHIS ADOCUMENTS LCSTATEMENTOAPPDOFORM %C3B-%hT AND DOC_NEW T AND DOC_OPEN $T AND NOT DELETED() %T ORDER BY 1 SELECT DOC_DESCR, DOC_EXEC, DOC_CLASS, DOC_SINGLE, DOC_NOSHOW, DOC_GO, DOC_NAV, DOC_WRAP, ALT_EXEC FROM (tcMetaTableName) WHERE DOC_TYPE = "F" &lcConditions INTO ARRAY THIS.aDocuments B UTCMETATABLENAMETHIS ADOCUMENTS LCCONDITIONSLNEWLSORTEDInit, execdocumentfilldocumentsarrayp1bqAA4q2AAqqA5qbrBrABA* 5 N1)m q%-9U%C3B-%hT AND DOC_NEW T AND DOC_OPEN $T AND NOT DELETED() %T ORDER BY 1 SELECT DOC_DESCR, DOC_EXEC, DOC_WRAP, ALT_EXEC FROM (tcMetaTableName) WHERE DOC_TYPE = "R" &lcConditions INTO ARRAY THIS.aDocuments B UTCMETATABLENAMETHIS ADOCUMENTS LCCONDITIONSLNEWLSORTEDT%C-B H> CC TCC&lcStatement  CCC20CCCCCU LIROWTHISFORM LSTDOCUMENTSVALUETHIS ADOCUMENTS LCSTATEMENTOAPPDOREPORT %C (B- %b)TChoose a report to modify&TChoose a report to runUTOAPPTLADDTHISCAPTIONfilldocumentsarray, execdocumentInitA1qbrBsABA6q2AAqqB5bqAaA3)# G)  S% J|UTCT6TC $C $C $"TCC%FT%C  T C FT  3TC D!TCD'T C DT(T   U LIMAXROWSLNLISTROWHEIGHTLNLISTMAXHEIGHTLNLISTMINHEIGHTLNMARGINTHIS ADOCUMENTS LSTDOCUMENTSTOPFONTNAMEFONTSIZEHEIGHTMINWIDTHWIDTH MINHEIGHT CMDCANCEL MAXHEIGHTLEFT CG US %C  B-CLCtoApp.cMetaTablebCCa C _APPLICATION >Must pass a reference to an object descended from _APPLICATIONTT H#L CCC.dbf   CC C 7C"No registered documents available.0 x C &T THISFORM.aDocumentsT  C2# Ta&T THISFORM.aDocuments% CT BUTOAPPTLNEWLATEMPLLRETURNTHISLNEWOAPP CMETATABLEFILLDOCUMENTSARRAYGETRESOURCEFILENAME ADOCUMENTSCCAPTION LSTDOCUMENTS ROWSOURCEVALUE EXECDOCUMENT CTUTHISOAPPq  Hj =C bC2jUNKEYCODE NSHIFTALTCTRLTHIS CMDCANCELCLICKCMDOKT/J("J(TJ(U LNMARGINTHIS LSTDOCUMENTSLEFTWIDTH CMDCANCELCMDOKTOPHEIGHT9%C2 C CUTOAPPTHISSETDIALOGSIZEPARAMETERSRESIZEsetdialogsizeparameters,LoadInitDestroyKeyPressResizeapplyappattributes1qR2c#rAAB42r24a2qAT ta1aAA32AAA3q2"24qA4#&*/X2 \= N iDw z) h OOj % U8 %C  1 CUNKEYCODE NSHIFTALTCTRLTHISDBLCLICKCUTHISFORMCMDOKCLICKKeyPress,DblClick1QAA21})O ]%U7%C # C CUTHISFORM LSTDOCUMENTSVALUE EXECDOCUMENTRELEASEClick,1aA3x)  %ShbU CUTHISFORMRELEASEClick,11#)_ FF[ %=U %CCC TCTC%CCRC C TTC  T(C'%CCC* >=* TC %CC t)TCCC* >\TC TU TCFAVORITEIDTOADDTHISLNEW LCCURRENTIDSLCIDLIIDOAPPCCURRENTUSERFAVORITEIDS ADOCUMENTS%0%CC [J-(3JCCC* >=* (J (UTHISLNEW LSTDOCUMENTSVALUE ADOCUMENTSCMDOKENABLED CMDREMOVE  TTC9%C CCC* >=*  |B Hs CCB CC 7C%T 3T2s4TCCC* >\C%TT CU THISLNEWLIROWLICOUNT LSTDOCUMENTSVALUE ADOCUMENTSREQUERYREFRESHFAVORITEIDS C%T%T#J(U LNMARGINTHISHEIGHT LSTDOCUMENTSTOP CMDBROWSE CMDCANCELLEFT CMDREMOVEw -   T CEXACTvOFF % yG  T T %C T C.dbf %C )T DOC_OPEN AND NOT DELETED() SELECT DOC_DESCR, DOC_EXEC, DOC_CLASS, DOC_SINGLE, DOC_NOSHOW, DOC_GO, DOC_NAV, DOC_WRAP, ALT_EXEC, DOC_TYPE, STR(RECNO()) AS DOC_ID FROM (lcTable) WHERE &lcConditions INTO ARRAY THIS.aDocuments J ( TC a%()T CC #%CC %-T* CT%-%C C C0 TT     T CCf%-T * C  % G%C&%   AT/B    UTCMETATABLENAMETHIS ADOCUMENTSLITALLY LIDOCUMENT LCCONDITIONS LAFAVORITESLIFAVES LCDOCUMENT LLEXACTSETLCTABLELIDOCSOAPPGETRESOURCEFILENAMECCURRENTUSERFAVORITEIDSLNEWLSORTEDLALLOWFILEBROWSING%T B%CC*CC CC ͫ  B%CCUTCCfTC!%CSCTLBTFRTTCC>=XTCC>=X%C0 FC B TaK'%CC C* >=*  CB%TC  -T * C G%CC  CTC TaTC%&%C "C aTCEXACTvOFF %G %C %yTC 6%CC CCC  ST  "T * C T CNCC C &has already been picked for Favorites.0 x %G %OC  Hd CC  TCC  &lcStatement  C CC 2%CC  R/0CCC CC  hCCC CC C C C C  UTCFILELIROWLCEXTLCFILE LCSTATEMENT LAFAVORITESLLDOCUMENTFROMDISK LLEXACTSETTHIS LSTDOCUMENTSVALUE ADOCUMENTSOAPPFILENOTFOUNDMSGBOXREMOVEDOCUMENTLNEWCCURRENTUSERFAVORITEIDSREQUERYREFRESHFAVORITEIDSTHISFORMCCAPTIONDOFILEDOREPORTDOFORM  TTCtoApp.cMetaTablebCCa C _APPLICATION >Must pass a reference to an object descended from _APPLICATION H C /%   T %\.T !Documents available for Favorites|T  Quick StartR,:C =... T CR %C C 0 C  7C"No registered documents available.0 xTB-, C  &TTHISFORM.aDocumentsT C TB-2&TTHISFORM.aDocumentsT %x1T!Documents available for FavoritesT\  .UserOpts-D(  .UserOpts laOptionsTaU TCWHICHSET LLCURRENTLCARRAYLOFORM LOMEDIATOR LAOPTIONSTHISOPGBELLVALUETXTBELLOAPPAPPLYGLOBALUSEROPTIONS FORMCOUNTFORMSGETFORMMEDIATORREF DOSESSIONSETSREFRESHCUSERTABLEALIASCMDRESETTODEFAULTENABLED2%CCCCURRENTSAVED  @B- TCURRENT%  @ .UserOpts %TCBELLTCBELL%CCTCBELLv%OFF@T [T  %TCBELL TO"TCBELL TO%CC|TCCf,0TC[TCC]%C C0 TT T xT CBELLvT CBELLv %TCCONFIRM"TCCONFIRM%CC5#T CCONFIRMvONWT ON %TCSHOWTIPS#TCSHOWTIPS%CLT  T  %4'TCcTextDisplayFontg+TCcTextDisplayFont%CCT T  %TCHOURS  TCHOURS%CC8TCCHOURSv_%CmT T U TCWHICHSET LLCURRENTLVVALUETHISOAPPCUSERTABLEALIASGETUSEROPTIONSETTING LAOPTIONSOPGBELLVALUETXTBELL CHKCONFIRM CHKSHOWTIPSSHOWTIPSCBOTEXTDISPLAYFONTCTEXTDISPLAYFONTOPGHOURSBUTTONSCAPTION0 %) CUNKEYCODE NSHIFTALTCTRLTHISRELEASE CTUTHISOAPP8TC %%C(T  User OptionsT C!%CC .UserOptsΡ3R,:C#User option defaults not yet saved!=T - T-% C  1 C U TOAPP LLSUCCESSCUSERTABLEALIASTHISCAPTIONCCAPTIONOAPPDISPLAYCURRENTUSEROPTIONSCMDRESETTODEFAULTENABLED ISERRORFREERELEASEdisplaycurrentuseroptions,saveuseroptionsfromdisplay`displayuserdefaultoptionssetuseroptionsfromdisplaysetfromdisplaydisplayoptionsKeyPress#Destroyapplyappattributes1r4A5R4q3qqA2q1aAsqA1QAAA2B5q#qABAQ1AA11A!AQa11AA!AQ1A1AQa1AqAQ1AAQaA11A3A22qq!1AABA2%|O  B}%Dm) \%U? C/R,:CUser options have been applied.=UTHISFORMSETUSEROPTIONSFROMDISPLAYClick,16q) %UE C5R,:C%User option defaults have been saved.=UTHISFORMSAVEUSEROPTIONSFROMDISPLAYClick,1R4) %UE C5R,:C%User option saved defaults are shown.=UTHISFORMDISPLAYUSERDEFAULTOPTIONSClick,1Q2)&   % UT %CC( MICULAFONTSLCFONTTHISADDITEMInit,1qRAA2) $   r%U:#% C 3CUTHISVALUETHISFORMTXTBELL CMDPICKWAVCLICKInteractiveChange,11A1z)  zzR+%1 UTCCCwavf%CC0  xT%tTTTULCFILETHISFORMTXTBELLVALUEOPGBELLClick,1qa1q1A11A12)z %/!QU %C TC,%C C C  &TC%C  T C   +% C  T TB-UTCAPPREFLOAPPTHIS GETAPPREFCCONTEXTMENUFILECCONTEXTMENUPADCCONTEXTMENUPOPUPICONTEXTMENUINDEX DOCONTEXTMENU CTOOLBARCLASS ITOOLBARINDEX DOTOOLBARCTOOLBARCLASSLIB LADDAPPICONTHISFORMICONTITLEBARCICON CTC%C4B%C ^C%C C TULOAPPTHIS GETAPPREFICONTEXTMENUINDEXRELEASECONTEXTMENU ITOOLBARINDEXRELEASETOOLBARloadapp,Destroy31qqcB2B1AqB3rAA32B22B4^$) { { ΋%FFU1C C@xBU TCMESSAGETHISCAPTION\%CCUT)J(U TVNEWVALTHISCTEXTDISPLAYFONT PGFERRORLOGPAGE1 EDTLISTINGFONTNAMEPAGE2 EDTUSERNOTESTT%T #TBJ (  .J (  UTHIS PGFERRORLOGHEIGHTWIDTH TXTERRSTAMPLEFTSPNNAV PAGEHEIGHTPAGE1 EDTLISTINGTOPIMARGINPAGE2 EDTUSERNOTES %CTTTC %,J(  C B-U THIS MINHEIGHTHEIGHTMINWIDTHWIDTHIMARGIN PGFERRORLOGPAGE1 EDTLISTINGLEFTPAGE2 EDTUSERNOTESRESIZE%CN 'T-"JCN(J(JCO( C U THISCALIASSPNNAVENABLEDSPINNERHIGHVALUEKEYBOARDHIGHVALUESPINNERLOWVALUEKEYBOARDLOWVALUEVALUEREFRESH%CT%CC0 ~/CThe error log is not available.B-Q%C /CThe error log is not available.B-%CCN1-CThe error log has no records.B-#6#T .ErrStamp(T .Listing*T  .UserNotesC B-UTOAPPLCTABLECERRORLOGTABLENAMETHISDONOLOGMESSAGECALIAS TXTERRSTAMP CONTROLSOURCE PGFERRORLOGPAGE1 EDTLISTINGPAGE2 EDTUSERNOTES APP_MEDIATORLOADAPP CREFERENCE5 %C  C .QUTHISCALIASdonologmessage,ctextdisplayfont_assign{Resize<InitActivateapplyappattributesDestroyi1qQA2qQA3Q1&B5111qA3a"A3qrqA2qABqAR1arB6A4y  2'Q5( AB ! m){ f MM%U<%%C CUTHISVALUESPINNERLOWVALUETHISFORMCMDBROWSEERRORLOGSETFOCUS<%%C CUTHISVALUESPINNERHIGHVALUETHISFORMCMDBROWSEERRORLOGSETFOCUS&# CUTHISVALUETHISFORMCALIASREFRESH DownClick,UpClickInteractiveChange71qA2qA2a1y $Z )M (%SbU TCW FTC%%CloApp.oFrame.NamebC,T IN WINDOW (loApp.oFrame.Name) T IN SCREEN BROWSE FIELDS errstamp :H= "Error Date and Time", field2 = LEFT(Listing, 20) :H="Tech Listing", field3 = LEFT(UserNotes,10) :H= "Your Notes Go Here" WINDOW (THISFORM.Name) FONT (THISFORM.cTextDisplayFont) &lcFrame CT CO F TU LCFRAMELOAPPISELECTTHISFORMCALIAS APP_MEDIATOR GETAPPREFREFRESHSPNNAVVALUEClick,1AQA !1s) {{8%2U%CO0 TITC%CO CT TUTOAPPLOAPPTHIS GETAPPREFTHISFORMCTEXTDISPLAYFONT dosessionsets,1qrRAR1A3){ % (>U}%C_)%CTHISFORMSET.BaseClassbCG B[ BvBUTHISOSESSION THISFORMSET DATASESSIONTHISFORMF%C(BC DATASESSIONv?BUTHISOSESSION DATASESSIONID UTVNEWVALTC%C:B%C%CTHISFORMbOpB TTTC %TCJ( BU TLDATACHANGEALREADYCONFIRMEDLOAPPLLRETURN LOSESSIONTHIS GETAPPREFOSESSIONTHISFORMQUERYDATASESSIONUNLOADTC%C3B%C%CTHISFORMbOiB~ TTTC %TCJ( BU LOAPPLLRETURN LOSESSIONTHIS GETAPPREFOSESSIONTHISFORMQUERYDATACHANGED ICHANGEMODE T%CO; TTTC%CkBT TUTOAPPLOAPPTHIS GETAPPREFLADDINGLADDINGNEWDOCUMENT T%CO; TTTC%CkB%4 H0 C C9 CTHISFORMSET.DataSessionbN   C (C 20% %C nC C   TU TOAPPLOAPPTHIS GETAPPREFLSESSIONSETTINGSOSESSIONSETDATASESSIONENVIRONMENT DATASESSIONID THISFORMSET DATASESSIONTHISFORMLUSERSESSIONSETTINGSAPPLYUSEROPTSFORSESSIONTTC%CEB-C%{C TUTCAPPREFTHISCAPPREFLOAPP GETAPPREF DOSESSIONSETSLSETDOCUMENTTONEWONAPPLOADSETDOCUMENTTONEW%CB [%C .BaseClassbCCCa C _APPLICATION BCBUTHISCAPPREFLACHECK<%CCC 5TUTVNEWVALTHIS COUTPUTALIASI %C C  .BCB BUTHISCOUTPUTCAPTION COUTPUTALIAS\ TC%C/BTCa T BULOAPPLLRETURNTHIS GETAPPREF DOTABLEOUTPUT[ TC%C/BTC T BULOAPPLLRETURNTHIS GETAPPREF DOTABLEOUTPUT`TT%CBBCSessionNYBCULCCLASSTHIS CSESSIONCLASS LCCLASSLIBCSESSIONCLASSLIB\ %C%B: TTCSAFETYvON %mG.TCPRG>C DEFINE CLASS  AS SessionC C +CDataSession = 2C C a%C ENDDEFINEC C a  TCFXP %UG. U TCFILENAME LCFILENAMELLSAFETYTHIS CSESSIONCLASSCSESSIONCLASSLIB$%CC C 8 TTCFXP%C0 TCPRG%CC] T TCFXPT BULCVALTHISCSESSIONCLASSLIBlB%CC C CC C YTSession BUTHIS CSESSIONCLASSCSESSIONCLASSLIB9%C B2BUTHISOSESSIONNAME UVNEWVAL UVNEWVAL %C %%CC  cTTTC%COB-%CTHISFORMbOB-B-UTLCREATESESSIONTCSESSIONCLASSTCSESSIONCLASSLIBTHIS CSESSIONCLASSCSESSIONCLASSLIBOSESSION CREATESESSION CTUTHISOSESSIONdatasession_access,datasessionid_accessdatasessionid_assignJ queryunloadb datachangedsetdocumenttonew0 dosessionsetsloadappY getapprefRcoutputalias_assign coutputcaption_accessu outputonerecord outputw createsession writesessionclassdefinition csessionclasslib_accessP csessionclass_accessgdatasessionname_accessdatasession_assignQdatasessionname_assignhInitDestroy1!AA3!aA3q4qAA"AAAA3AA"AAAA3qqQAAA23qrRAAA2b2B2DB21AB4qrqAA5!qAqA5qA3A4AA"4AA31A3qAAaAaQaA4qBoQaAAA3$rA3!A5q3q3AAqAqAAqA22 ! )0:>[XL nk x +Y)Fy$,OcS^Bholp )"   !%VxU CTUTHISOAPPX% H H)- C_SCREEN.ActiveForm.ParentbOiG(9& C_SCREEN.ActiveFormbOG(92TCN %$ J(JCN(  T COT C FDCEnabled-  BU LLENABLETHISLDISABLEDFORMODAL ACTIVEFORMPARENT DATASESSIONIDSPNGOSPINNERLOWVALUEKEYBOARDLOWVALUESPINNERHIGHVALUEKEYBOARDHIGHVALUEVALUESETALLDestroy,RefreshV12qA1aB1"QAAA22Pe)  )%{U0%C )CUTHISPARENTOAPPGOTOPClick,1a1A1W) %U0%C )CUTHISPARENTOAPP GOPREVIOUSClick,1a1A1\) h%|U0%C )CUTHISPARENTOAPPGONEXTClick,1a1A1X) Q%~U0%C )CUTHISPARENTOAPPGOBOTTOMClick,1a1A1Z) %U6%C /CUTHISPARENTOAPP GOTORECORDVALUEInteractiveChange,1aA1o) %U4%C -C-UTHISPARENTOAPPDOSORTClick,1aqA1^) %U4%C -CaUTHISPARENTOAPPDOSORTClick,1aqA1^) %U0%C )CUTHISPARENTOAPPSHOWTABLESETFILTERDIALOGClick,1a1A1j) 6%(2U CTUTHISOAPP%B &%C_SCREEN.ActiveFormbO9+TC.ActiveControl.SelTextbC,J C  (  JC  ( %C O'/J-(    ZTCCC#_SCREEN.ActiveForm.Parent.BaseClassbfFORMSET996%CCy%J-(   %C J-( %J-(   '%C O C  \J-( %CC Ja(  JC ( %J-(   ULLACTIVEEDITINGCONTROLTHISLDISABLEDFORMODALLATEMPX LISESSION ACTIVEFORM ACTIVECONTROL SELLENGTHCMDCUTENABLEDCMDCOPYCMDPASTEOAPPCMDSAVE CMDREVERTCMDPRINTCMDHELPPARENT DATASESSIONID CHELPFILEDestroy,RefreshV12qAArbBqSARAAUrAbSAB22P) %U6%CO/CaUTHISPARENTOAPP DONEWOPENClick,1AA2c) #%U5%CO.CUTHISPARENTOAPP DONEWOPENClick,11A2`) %U5%CO.CUTHISPARENTOAPP DATAUPDATEClick,11A2a) %U5%CO.CUTHISPARENTOAPP DATAREVERTClick,11A2a) /%U>%CO7CUTHISPARENTOAPP DOTABLEOUTPUTLPRINTONERECORDClick,1A2) \%U;%CO4CCUTUTHISPARENTOAPPDOMENUITEMINFRAMEClick,1A2m) %U<%CO5CCOPYUTHISPARENTOAPPDOMENUITEMINFRAMEClick,1A2n) r%U=%CO6CPASTEUTHISPARENTOAPPDOMENUITEMINFRAMEClick,1A2o) %U5%CO.CUTHISPARENTOAPPDOHELPClick,11A2]) %c /U TC %6TC %XTC!%C Loading... %COCR,:C Loading...= %TC %TC %)TC  %KTC  %T C TC  %TC  %TCR %TC C BU LLSUCCESSTHISSAVEENVIRONMENTVALIDATEMETATABLE CREATEFRAMEOFRAMESHOWRESETFORMSCOLLECTIONCREATECOLLABORATORSHANDLEPROJECTWINDOWSETENVIRONMENTCUSERTABLEALIASCUSERTABLENAMESETCURRENTUSERSHOWSTARTUPELEMENTSACTIVATERESTOREENVIRONMENTgC CC C CC /      CTC'TCCC CC@6%CTC.scxTC.vcx%C*B-&T CC ,6 %N(J0%C CCO F8%CCfFORMC T%CO(CB-*%C  B T#T %COC%C H%TCmJT  % RT CTC fFORMSET %  }%C fFORMyT C  %C OuC" !T #T $ Ta$T CC% %C OC" !T #T $ %  %  C  %C fFORMT C &%C OC" !T #T $% %CO2 %   C . C  %  % '| Ta!   %C ( C % 'C ( C %) NC +*BC,U- TCFILENAMETCCLASSTLNOMULTIPLEINSTANCESTLNOSHOWTLGOMENU TLNAVTOOLBAR LCFILENAMELCCLASSLNCOUNT LCFORMNAME LNFORMCOUNT LOMEDIATORLOFORM LOFORMMEMBERLNEEDREACTIVATEFORMSET LLFORMSETLLENABLEDFORMFOUNDTHISCLEARLASTERRORGETRESOURCEFILENAME NFORMCOUNT AFORMNAMESAFORMS BASECLASS WINDOWSTATEOFRAMESHOW BEFOREDOFORMFREFRESHFORMSCOLLECTION INSTANTIATEFORMSGETFORMMEDIATORREFLOADAPP CREFERENCELGOMENU LNAVTOOLBARLENABLEFORMSATRUNTIMECREATEFORMMEDIATOR SHOWWINDOWACTIVATEFORMINFRAME LCASCADEFORMS CASCADEALLNAME ISERRORFREEC CC C CC  C%C vB-TC%TC .frx .lbx %+CFeature not available.@x%CB--TC _outputdialog_reportsa %CO#    T C y%    ( TC  %C+T T COTaT%Cl!T CCԼT TCTCT-TTaC T%  ( TC  %C \.%C  #6 H#C %C C٤The report you chose cannot run properly in the current environment or has created a problem for the current environment. You may need to re-start this application.xT-B-BCU TCFILENAME TCDESCRIPTIONTLMODIFY LCFILENAMETHISCLEARLASTERRORGETRESOURCEFILENAMECCAPTIONLODIALOGDOMODALDIALOGCLASSLARECNOS LAWORKAREASLIUSEDLIROWLCALIASLSKIPERRORHANDLINGICONCICONCAPTION CHTMLCLASS SETHTMLCLASS CHTMLSTYLEIDSETHTMLSTYLEIDLADDSOURCENAMETODROPDOWNCREPORTLPREVENTSOURCECHANGESSHOW ISERRORFREE C CC C CC  CTC%C|B-TC.lbx%CB-%CTCCּ TCBCU TCFILENAME TCDESCRIPTION LCFILENAME LCDESCRIPTIONTHISCLEARLASTERRORGETRESOURCEFILENAMEDOREPORT ISERRORFREE C CC  CTC%C^B-!TC .mpx .mpr%CB-%CO BCU TCFILENAMETLUNIQUEPOPUPNAMES LCFILENAMETHISCLEARLASTERRORGETRESOURCEFILENAMEOFRAME CMENUNAME ISERRORFREE7 C%"BCUTHISCLEARLASTERROR LREADEVENTS ISERRORFREE) C%"9UTHISCLEARLASTERROR LREADEVENTS1C CC  CTC%CZB-+TC.exe .app .fxp .prg%CB-&%ChCCfPRG %CC]  TCFXPB- BCU TCFILENAME LCFILENAMETHISCLEARLASTERRORGETRESOURCEFILENAME ISERRORFREE% TCSHUTDOWNTCPATHvTCERRORTC DIRECTORYvTCMACKEYv'TMC].FKYT aD(T - %C C  T aU THIS LREADEVENTSCLASTONSHUTDOWN CLASTPATH CLASTONERRORCLASTDIRECTORY CLASTMACKEYCMACROSAVEFILE CAPPFOLDERLSKIPERRORHANDLING CFRAMECLASS CSTARTUPMENULSAVEDENVIRONMENTj%   #Ba C%HTON SHUTDOWN &lcTemp TON ERROR &lcTemp TSET MACKEY TO &lcTemp G)(  %C 0@   %C C  D<Ta BCUTHISLRESTOREDENVIRONMENTLSAVEDENVIRONMENTCLEARLASTERRORLCTEMP LREADEVENTSCLASTONSHUTDOWN CLASTONERROR CLASTMACKEY CLASTPATHCLASTDIRECTORYCMACROSAVEFILE CFRAMECLASS CSTARTUPMENU ISERRORFREE%CCdCFile not found, or unavailable.C It may be in use.:C C 0x[C: File not found, or unavailable.C It may be in use.U TCFILENAME STARTMODETHISCCAPTIONCUSERRORRECORDSERVERERROR  H CCG Ta@ C_SCREEN.ActiveForm.ParentbO9 C 6 C_SCREEN.ActiveFormbO 9 C 2 Ta %T  %*TaTTCC3CAre you sure you want to quit?$ x  %TC  %T- %%  C 8 BU TLCALLEDFROMTOPFORMLLRETURN LLINTERRUPTED STARTMODE ACTIVEFORMPARENT WINDOWTYPETHIS LNOINTERRUPTCCAPTION RELEASEFORMSRELEASE %0BT  %tT a CC%CO+C#C f# #FORMSET##FORM# . %Ca-a ?%C- ; %0T -B-+TCC %%  %T -B- %T -UTLFORCE LNFORMCOUNTTHISREFRESHFORMSCOLLECTION NFORMCOUNTLOFORM LOMEMBERFORMLIRESULT LLINTERRUPTED LNOINTERRUPTAFORMS BASECLASS DATAREVERTQUERYDATASESSIONUNLOAD RELEASEFORM C%Ct^&%C_SCREEN.ActiveFormbOZC9%CO C BCUTOFORMTHISCLEARLASTERROR ACTIVEFORMRELEASEREFRESHFORMSCOLLECTION ISERRORFREENTTTUTHIS NFORMCOUNTAFORMS AFORMNAMES  C T+]%CCOlT.(!TCT!TCTT%6!#% BCU LNCOUNTLNCOUNT2THISCLEARLASTERROR NFORMCOUNTAFORMS AFORMNAMESRESETFORMSCOLLECTION ISERRORFREE[%BT%COP UTHIS LNOINTERRUPT LOTOOLBAR ATOOLBARSREFRESHy C CC C CC %Cv B%C  TTCCf TTC (TC E%COCC N C  S T.%C f+T C   B%#%CC OT  T T )%C OC   |C (T C  %CC Oi%%CC oApph T  T "  CC  BU TCCLASSLIBTCCLASSLCCLASS LOTOOLBAR LCCLASSLIB LIELEMENTLIINDEX LITOOLBARS LCTOOLBARNAMETHIS ATOOLBARSCLASSSHOWOFRAMENAME INSTANTIATEOAPPDOCKIINITIALTOOLBARPOSITIONACTIVATEFORMINFRAME (CNCCͫ CL C%CtC rB- %CCN TTC% X %CCOCCTT TBCU TITOOLBARINDEXTLFORCETHIS ATOOLBARSCLEARLASTERRORLICURRENTTOOLBARREFCOUNTLICURRENTTOOBARREFCOUNTRELEASE ISERRORFREE/ CT  %PTaTC(1%CCOCa %  %T-B-T  %T-BC U TLFORCE LITOOLBARLITOOLBARCOUNT LLINTERRUPTEDTHISCLEARLASTERROR LNOINTERRUPT ATOOLBARSRELEASETOOLBAR ONAVTOOLBAR ISERRORFREE  C (CTC%CO#%CloMember.ParentbOC%CReleaseh C TTBC U THISCLEARLASTERROR LIMEMBERINDEXLOMEMBERACOLLABORATORSPARENT REMOVEOBJECTNAMERELEASE ISERRORFREEBCUTHIS ISERRORFREE?  CCC  C CC -CCCCCC]  C CC COC C CC TC H CC4T  T   C] T  T 2T C%CCT C,%CC ]CC .VCX] T   T  T&T C .vcx .fxp .prg %C _!T C .app .exe .%C C C C  B-&%ChCC fPRG %CC ]  T  T C FXPB-%CO%CCS TpTCC]pASSERT TYPE("toParent."+lcMemberName) # "O" MESSAGE toParent.&lcMemberName..Name + " "+"already exists"+"." C %CC xStoParent.NewObject(lcMemberName,lcClass,lcClassLib,lcContainer,&tcParamString.) %C TC toParent./%CTC +IloReturn = NEWOBJECT(lcClass,lcClassLib, lcContainer,&tcParamString.)  BUTCCLASS TCCLASSLIBTCCLASSCONTAINERFILENAME TCPARAMSTRINGTOPARENT TCMEMBERNAMELORETURN LCMEMBERNAMELCCLASS LCCLASSLIB LCCONTAINERTHIS CLASSLIBRARYCCLASSCONTAINERFILENAMEGETRESOURCEFILENAMECLEARLASTERROR NEWOBJECT ISERRORFREEBCUTHISCUSWINDOWHANDLERGETCURRENTTOPFORMREFBCUTHIS ILASTERRORTUTHIS ILASTERRORCCC C CC #  %CCC  BTC%C . TCC@%C0  TwTCTC.%ATC ._TC %C=.T.TC.(sT C.%T C.TC \.TC \TCC@%C0Z!o T%C C  BU TCSOURCEFILENAMETCEXTENSIONLISTTLSUPPRESSMESSAGELCSOURCEFILENAMELCTARGETFILENAME LCEXTLISTLCEXTLIEXTSLITRYEXTLITHISEXTSTARTSLINEXTEXTSTARTSTHISFILENOTFOUNDMSGBOX C%!T .OnShutdown()ON SHUTDOWN &lcTemp 6T".Error(ERROR(),PROGRAM(),LINENO())ON ERROR &lcTemp %CCTSET MACKEY TO &lcTemp G\(%C- H* C OO C     yCa2 BC U THISCLEARLASTERROR LREADEVENTSLCTEMP CREFERENCECMACKEYTOLNOSCREENDURINGAPPSETSCREENATTRIBUTESOFRAMESETFRAMEATTRIBUTES ISERRORFREEmT!TC"ClAddingNewDocument BUTLNEWLLRETURNTHISLADDINGNEWDOCUMENTDODOCUMENTPICKERDIALOG CNEWOPENCLASSCNEWOPENCLASSLIBRESETTODEFAULT%C TC%COTC %C C  BC U LOTEMPLIINDEXLLOKTHISCERRORVIEWERCLASSADDCOLLABORATORCERRORVIEWERCLASSLIBAPPLYAPPATTRIBUTESACTIVATEFORMINFRAMERELEASECUSERRORDISPLAYERRORLOGU TCFILENAMETCCLASSTLNOMULTIPLEINSTANCESTLNOSHOWTLGOMENU TLNAVTOOLBARp CLGCtoSession.DataSessionIDbNC_SCREEN.ActiveFormbO T  %Ta+%CtoSession.DataSessionIDbN TT9%C .TCa A Ta %`T- BU TLDATACHANGEALREADYCONFIRMED TOSESSION LLDATAHANDLED LOSESSION LLINTERRUPTEDTHIS LNOINTERRUPT ACTIVEFORMCUSDATASESSION DATACHANGED QUERYUNLOAD TCC]f%C>TT% PROCEDURETC \(TCC \%C0 T#%CCRVCTDCTT!Ct(TCC]f&%CCRAPPEXEDLLT!BCULCSYS16LILEVELTHIS CAPPFILENAMECCLASSCONTAINERFILENAME ISERRORFREE  T  %CTaTC %~T- BU TOSESSION TICHANGEMODELLRETURN LLINTERRUPTEDTHIS LNOINTERRUPTCUSDATASESSION DATACHANGED T  %KTa$TC %T- BU TLUSERCHOICEALREADYCONFIRMEDTLDATACHANGEALREADYCONFIRMED TOSESSIONTLNOSHOWLLRETURN LLINTERRUPTEDTHIS LNOINTERRUPTCUSDATASESSIONUPDATE T  %KTa$TC %T- BU TLUSERCHOICEALREADYCONFIRMEDTLDATACHANGEALREADYCONFIRMED TOSESSIONTLNOSHOW LLINTERRUPTEDLLRETURNTHIS LNOINTERRUPTCUSDATASESSIONREVERT<%CC! B5 BUTHISCCAPTIONK%CC,TDTUTVNEWVALTHISCCAPTION[ %C <!TC .icoTTUVNEWVALTHISCICONGETRESOURCEFILENAME BUTHIS ILASTERRORN-TCCCC 6TU TCDATAFOLDER LCDATAFOLDERTHIS CDATAFOLDER%CCn1%C.NamebC C Z <T?%C (C.NamebC C   < 7J(U TCREFERENCETHIS CREFERENCE;!%C C  %C ZTCC\=*%C C   C  TCC\=%C C  TC DIRECTORYvT%CR\(T\ BUTHIS CAPPFOLDER LCAPPFOLDERCCLASSCONTAINERFILENAME CAPPFILENAME%C B- H1 E 2Ta"%CCNTBAR("_mGo")bU H COC C C-2. H* CO|s"\ BnT C BaUTCWHICHDIALOGCLASSTCWHICHDIALOGCLASSLIBTLNOSHOW LOFORMREFLCWHICHDIALOGCLASSLIBTHISOFRAMESHOW INSTANTIATEAPPLYAPPATTRIBUTESICONCICON WINDOWTYPEACTIVATEFORMINFRAME H C C B T& C_SCREEN.ActiveFormbOzT92B-U TCFORMNAME LCFORMNAME ACTIVEFORMNAMECUTCFORMTHISCUSWINDOWHANDLERCASCADEFORMINSTANCES6 CUTCFIELDTCALIASTCTAG TLDESCENDINGTHIS CUSTABLESORTDOSORT/TaCT-UTHIS LNOINTERRUPT CUSTABLENAVGOTOP/TaCT-UTHIS LNOINTERRUPT CUSTABLENAVGOBOTTOM/TaCT-UTHIS LNOINTERRUPT CUSTABLENAVGONEXT/TaCT-UTHIS LNOINTERRUPT CUSTABLENAV GOPREVIOUS?,TC _GoTodialog _table.vcx BULLRETURNTHISDOMODALDIALOGCLASS -TC _FindDialog _table.vcxa%COTT  %TaC %T-B-ULOFORM LLINTERRUPTEDTHISDOMODALDIALOGCLASS LADVANCEDLFINDONMULTIPLETABLES LNOINTERRUPTSHOWC-TC _FilterExpr _table.vcxa%CO|TCB-ULOFORMTHIS CUSTABLENAVSETTOACTIVESESSIONDOMODALDIALOGCLASS LADVANCED LUSE_GETEXPRSHOW  CTC(1%CCCCa % B- <BCU TLFORCELIMENU LIMENUCOUNTTHISCLEARLASTERROR ACONTEXTMENUSRELEASECONTEXTMENU_MGO ISERRORFREEiTC DATASESSIONv%CNI G( C G(U TISESSIONID LISESSIONIDLITHISSESSIONIDTHISSETDATASESSIONSETSG_ G2Ue %C F+TC .bmp .ico .gif^TUVNEWVALTHISCIMAGEGETRESOURCEFILENAMET%C\BT%C.rT.DBF BULCTABLETHISCERRORLOGTABLENAME CAPPFOLDER TC %CC OvT %C  T2T C BC U TCCLASS TCCLASSLIBTCCLASSCONTAINER TCPARAMSTRINGTOPARENT TCMEMBERNAME LIELEMENT LCCLASSLIBTHISACOLLABORATORS INSTANTIATE +%COCfFORM =B TTCEXACTvOFF %G +%CtoForm..NamebC)TCtoForm.:%CaCC _formmediatorf % T%C   I%COCa CC _formmediatorf  T!%C TC  %G BU TOFORMTLFORCE BASECLASSLOMEMBERLACHECK LOMEDIATOR LLEXACTSETTHISCFORMMEDIATORNAME CONTROLCOUNTCONTROLSCREATEFORMMEDIATORBCC UTOFORMTHISGETFORMMEDIATORREF C%C 7T%C TC%COTTBCU LCCLASSLIBTHISCLEARLASTERRORCFRAMECLASSLIB CFRAMECLASSOFRAME INSTANTIATEOAPP ISERRORFREEN%COGTCTUTHISOFRAMEOAPPRELEASE7.TC _SysToolbars_app.T.2TC _ObjectState_app_SCREEN%CO %%C CCaptionaCIconaCVisiblea0%9 , T9aUTLONLOTEMPTHISADDCOLLABORATORCCAPTIONSETCICONVISIBLEh%COBTTTU THISOFRAME BACKCOLORCUSWINDOWHANDLERIMDIWORKSPACECOLORICONCICONCAPTIONCCAPTIONTa%CO=C.TCCC  % C  V HR COTCa   TC 2R%C TC N'TCC    %%COCG&(T-% C BU LLSUCCESSTHIS LNOINTERRUPTOFRAMESHOWCSTARTUPTOOLBARCLASS DOTOOLBARCSTARTUPTOOLBARCLASSLIB CSTARTUPMENUDOMENU LREADEVENTSCSTARTUPMENUPAD DOCONTEXTMENUCSTARTUPMENUPOPUP LSTARTUPFORM DOSTARTUPFORM%C C 'BT9 T9aT9%9 y C9%C ,t,UTCWINDOW STARTMODE LLAUTOCENTER AUTOCENTERVISIBLESHOWSCREEN5%CBCUTCTOKENTHISCUSWINDOWHANDLERINVOKEMENUITEMINFRAMEV%C B- H1K UT Ta%COTCTC% C 2KT-&%CO  GC BU TLNAVTOOLBARNEEDEDTHISCNAVTOOLBARCLASS LNAVTOOLBAR ONAVTOOLBARLIINDEX DOTOOLBARCNAVTOOLBARCLASSLIB ATOOLBARSVISIBLESHOWHIDE:TaCT-UTIRECORDTHIS LNOINTERRUPT CUSTABLENAV GOTORECORDBCUTHIS CUSTABLENAVGETCURRENTALIAS+  &%C_SCREEN.ActiveFormbO|T9 TC TC DATASESSIONv H' CloActiveForm.ParentbOG( COG(%COJ CTT%Ci TC%CTC%CCCN  % 'T    % T a%C  T# TBTNEXT 1%C %C+r TTCO5%C  CN C  g%C )T(Current Record)-TC _outputdialog_reportsa %COTTT T-TCa TCa T T!aT" #C$ T T a%K #6 Hc#%CO C% G( % T - B U&TLOUTPUTONERECORDLODIALOG LOMEDIATOR LOACTIVEFORM LISESSIONLCALIAS LCCAPTIONLCSCOPELIRECNOLLRETURN LLINTERRUPTED ACTIVEFORMTHISGETFORMMEDIATORREFPARENT DATASESSIONIDPREPAREOUTPUTALIAS COUTPUTALIASCOUTPUTCAPTION LNOINTERRUPT CUSTABLENAVCURRENTTABLEALLOWSNAVIGATIONDOMODALDIALOGCLASSCSCOPECALIASCAPTIONLADDSOURCENAMETODROPDOWN CHTMLCLASS SETHTMLCLASS CHTMLSTYLEIDSETHTMLSTYLEIDICONCICONLPREVENTSOURCECHANGESCDISPLAYFONTNAMECTEXTDISPLAYFONTSHOWCLEANUPOUTPUTALIASTCf%C\DT%C.tT.DBF4%CC]CCC.DBF.FPT] C BULCTABLETHISCUSERTABLENAME CAPPFOLDERCREATEUSERTABLEo1%CCCC&   PTUC]hTUTCNEWVALTHISCUSERTABLENAMECUSERTABLEALIASCL  C%C Q%C {B- Ta%%C  TC TC  C Ta %!T C. !TC. C C CC% C %Q BU TLCHANGEUSER LLOPENEDTABLE LLSUCCESSTHISCLEARLASTERRORCUSERTABLEALIASCUSERTABLENAME ISERRORFREELUSERPREFERENCES CCURRENTUSER DOUSERLOGINSEEKCURRENTUSERSEEKDEFAULTUSERCUSERTABLEIDFIELDICURRENTUSERLEVELCUSERTABLELEVELFIELDSETUSERPERMISSIONSFILLUSEROPTIONSARRAYAPPLYGLOBALUSEROPTIONSSETCURRENTUSERFAVORITEIDS LREADEVENTS SETMACROS T!TC%  sC BU TLADDLLRETURN LCFAVORITEIDSTHISCCURRENTUSERFAVORITEIDSDODOCUMENTPICKERDIALOGCSTARTUPFORMCLASSCSTARTUPFORMCLASSLIBSETCURRENTUSERFAVORITEIDSe/%CNC FT^TUTINEWVALTHISIINITIALTOOLBARPOSITION5%  B. BUTHIS LABOUTBOXCABOUTBOXCLASS BUTHISCSTARTUPFORMCLASS5%  B. BUTHISLSTARTUPTOOLBARCSTARTUPTOOLBARCLASSd%C%B- %C Q T%CO}C:TCTHIS,C .T..F.6%CON(%CApplyAppAttributesh C :%C 6T  C]B-U TCCLASS TCCLASSLIBTLALTERNATEMODELOTEMP LCCLASSLIBTHISOFRAMESHOW INSTANTIATEAPPLYAPPATTRIBUTESICONCICONU%CC< TTT%C Q%C  B- Ta%CDELETEDvOFF T-G % -5TCCCCC. >IDr=TCCCCfCC. >ID_Upper %G %Q BU TCNAME LLOPENEDTABLE LLSUCCESSLCNAME LLDELETEDOFFTHIS CCURRENTUSERCUSERTABLEALIASCUSERTABLENAME ISERRORFREELUSERNAMEISCASESENSITIVECUSERTABLEIDFIELDC CTT TCWFUh1C<IM M M M M/INDEX ON PADR(ALLTR(&lcIDField.),60) TAG ID <INDEX ON PADR(UPPER(ALLTR(&lcIDField.)),60) TAG ID_Upper & C' Q FBCUTCTABLETHISCLEARLASTERRORLISELECT LCIDFIELD LCLEVELFIELDCUSERTABLEIDFIELDCUSERTABLELEVELFIELDUSERPASSUSEROPTSUSERFAVE USERMACRO USERNOTES IFDELETED ISERRORFREEC% 'B-TCa%COCBC+ B-UTHISCUSERTABLEALIASLUSERPREFERENCESLOFORMDOMODALDIALOGCLASSCUSERLOGINCLASSCUSERLOGINCLASSLIBSHOWC@%C .UserOptsbMCC .UserOptsΡ @ .UserOptsCC UTHISCUSERTABLEALIASACURRENTUSEROPTS LAOPTIONSO%CO BT  %lTaTC DATASESSIONvG( (C %C .TC TC %CC!.%C TC.c% Ch >2CC toSession.C\C\h   toSession.&lcItem. = lvValue %CC.SET &lcItem &lvValue  G( %DT-BU TOSESSION LISESSIONLIROWLCITEMLVVALUELIPOS LLINTERRUPTEDTHIS LNOINTERRUPT DATASESSIONIDACURRENTUSEROPTS%C aQ%C RB- Ta%CN%C #) %QU LLOPENEDTABLETHISCUSERTABLEALIASCUSERTABLENAME ISERRORFREESEEKCURRENTUSER(C%C O.TCTC%CC.%C ITC.^% Ch 9-CCTHIS.C\C\h  ETHIS.&lcItem. = lvValue %CCj.SET &lcItem &lvValue BULIROWLCITEMLVVALUELIPOSTHISACURRENTUSEROPTSr %CC'B1%CtCtaOptionArray[1,1]bC cB %CtC C TCEXACTvOFF %G TC % G%C \TCBCkBUTCOPTION TAOPTIONARRAY LIELEMENTLIROW LLEXACTSETLATEMPTHISACURRENTUSEROPTSNT%CC0 t4CThe error log is not available.@xB CTa TCWTEC]QT-%C C  s CMC8The error log is in use, please close before continuing.x%Ck QB%CN TCSAFETYvOFF %G.  FS F %G.%CN82CThe error log has no records.@x QBU LCTABLELISELECTLCALIASLLSAFETYTHISCERRORLOGTABLENAMECCAPTIONCLEARLASTERRORLSKIPERRORHANDLING ISERRORFREET%CC0 |4CThe error log is not available.@xB C TCWT ExportErrors%CTEC]F Q TC%C ( C FBDo C  C Q C Q  F Q% w-TC _outputdialog_reportsa%COsTTTaTTCaTCaC T Ta2CThe error log has no records.@x%C Q F BULCTABLELISELECTLCALIASLODIALOG LCTABLEALIASLLRETURNTHISCERRORLOGTABLENAMECCAPTIONCLEARLASTERROR ISERRORFREEERRSTAMPLISTING USERNOTESDOMODALDIALOGCLASSICONCICONCALIASLPREVENTSOURCECHANGESCDISPLAYFONTNAMECTEXTDISPLAYFONT CHTMLCLASS SETHTMLCLASS CHTMLSTYLEIDSETHTMLSTYLEIDSHOW?% *CCNTBAR(THIS.cFavoritePopupName)bN FB-%T (C <  T C %C TMC]Q %C  ^GN aGN aB TCW%C  F%C CaJ(%C TCCf T%C0Ts "T.TDoFileT([])8#%C C 4Ts "C H0 C TC 1TDO ([C]) Rx5T .DoReport([C],[C]) F(T .DoForm([C],[C],C .T.,.F.,6C .T.,.F.,6C .T.,.F.,6C .T..F.6)20%C GON SELECTION BAR liBarNo OF (THIS.cFavoritePopupName) &lcStatement  GN %C  Q FUTHIS LFAVORITES LCTHISREF LCSTATEMENT LCFAVORITEIDLIBARNOLCALIASLISELECT LAFAVORITES CREFERENCECFAVORITEPOPUPNAMECLEARLASTERROR CMETATABLE ISERRORFREECCURRENTUSERFAVORITEIDSSEEKMETATABLEFAVORITEID DOC_DESCRALT_EXECDOC_WRAPDOC_EXECDOC_TYPE DOC_CLASS DOC_SINGLE DOC_NOSHOWDOC_GODOC_NAV%CCC )BTC%CC( %CfCfT!UTCNEWVALLATEMPLCVALLCFONTTHISCTEXTDISPLAYFONT  C!CVAL(tcFavoriteID)bNTCg% CN # BC' B-U TCFAVORITEIDTCALIASLIRECIDf!%CL   ,B C%C Q Ta%  C  C %C %%C .UserMacrobM H ;D( .UserMacro Ta# CC .UserMacroΡ  Ta@ .UserMacro2 %Q0%CCNTBAR(THIS.cMacroPopupName)bN_(C [%%CRestorefCC OfWGN  !UTLSAVETHIS LREADEVENTS LLOPENEDTABLELIBAR LLSUCCESSCLEARLASTERRORCUSERTABLEALIASCUSERTABLENAMELUSERPREFERENCESSEEKCURRENTUSERSEEKDEFAULTUSER ISERRORFREECMACROPOPUPNAME T C%C zQ  Ta%C %  C  C %C %CC@%C .UserFavebMCC .UserFaveΡ @%CC .UserFaveaCCbN {%CCBC%CDocument table for  has been changed. C -Some of your Favorites may not run properly. C C -Do you want to clear your Favorites list now?4xx*> .UserFaveTC .UserFave$TCCBCCC \*> .UserFave T"%CC .UserFaveΡ w(Cs%CC oTC CPC;Your Favorites entries appear corrupt, and will be cleared.x*> .UserFave%C %C p5> .UserFaveCCB T*> .UserFaveT %Q CUTCNEWVAL LLOPENEDTABLELCMETATABLELASTUPDATEDLCNEWVAL LAFAVORITESLIVALTHISCLEARLASTERRORCUSERTABLEALIASCUSERTABLENAME ISERRORFREELUSERPREFERENCESSEEKCURRENTUSERSEEKDEFAULTUSERCCAPTIONINCCURRENTUSERFAVORITEIDSREFRESHFAVORITEPOPUP: C %CCCC0 ^TC%CxB-TC %CB-T CCf %C C> TC TTCh H' C6 C SCX  SCT jTC  C LBX  LBT TC  C FRX  FRT TC   MPX TC T C MPR  MNX  MNT *CCMPR0 CCMPX0  fTC  C APP  FXP TC0  PRG CCFXP0  TC C QPX  SPX TC0  QPR CCQPX0  `TCCQPX0  SPR CCSPX0  TCCSPX2%C*+| ShellExecuteASHELL32%TCopenT  BUTCFILE LCFILENAME LIRETURNVALUELCEXTLCSTEMLLRETURN LLDEVPRODUCTTHISCLEARLASTERRORGETRESOURCEFILENAMEDOFORMDOLABELDOREPORTDOMENU DOPROGRAM SHELLEXECUTEASHELL32bK%C-Do you want to clear your Favorites list now?$x[CUTHISCCAPTIONSETCURRENTUSERFAVORITEIDSc.%  C CC <B- >CUTCVALUETOSTORETHISLUSERPREFERENCESCUSERTABLEALIASUSERPASSCREATESTOREDPASSWORDIN,CCBCC]UTCVALUETOSTORECC C !%  CC [B-TC,TCALLTRIM( .UserPass)TC BUTCVALUETOCHECKTHISCUSERTABLEALIASLCVALUETOCHECKLCSTOREDPASSWORD LLSUCCESSLUSERPREFERENCESCHECKVALUEAGAINSTSTOREDPASSWORDB %CC'B-BC]UTCVALUETOCHECK TCSTOREDVALUE BUTHISLUSERCANCHANGEPASSWORD T UVNEWVALTHISLUSERCANCHANGEPASSWORD%% B-% LC7Your user-level does not allow access to this function.0xB- %C Q Ta CTC %Q BU THISLUSERPREFERENCESLUSERCANCHANGEPASSWORDCCAPTION LLOPENEDTABLELLRETURNCUSERTABLEALIASCUSERTABLENAMESEEKCURRENTUSERDOMODALDIALOGCLASSCCHANGEPASSWORDCLASSCCHANGEPASSWORDCLASSLIB G%CC C CProject Manager -   H[1 !CProject Manager -   $,Project Manager -  2$,Project Manager - TUTLSHOWTHIS CPROJECTNAME  CT T"Ca % TC   BU TCFILENAMETCCLASSTLNOMULTIPLEINSTANCESTLGOMENU TLNAVTOOLBARLOFORMLICOUNTTHISREFRESHFORMSCOLLECTION NFORMCOUNTDOFORMAFORMS UTCSOURCETLTABLE UTCSOURCETLTABLE8 C C CBCUTHISCLEARLASTERRORBEFOREREADEVENTS READEVENTS ISERRORFREE %CfTOOLBAR: Ta&%CO   %TT.TTWC]%C %   C  C  %`t,Tt,T% C U TOFORMREFLCFORMID LLTOOLBAR BASECLASSTHISOFRAME SHOWWINDOWCAPTIONNAME WINDOWTYPESHOW+%COCfFORM 9B +%CtoForm..NamebCTT Mediator_C] C'TC $%C C  q CT _FormMediatorT  _FRAMEWK.VCX'TC %C T  BBUTOFORM BASECLASSLCMEDIATORNAME LOMEDIATORTHISCFORMMEDIATORNAMECLEARLASTERROR INSTANTIATECMEDIATORCLASSCMEDIATORCLASSLIB ISERRORFREEFORMISFRAMEWORKENABLEDCAPPREF CREFERENCE %C C -Ba7     TMC] C%CQTQ TTCC % X=T Metatable in use or unavailable:C C  %LTC .DOC_TYPEbCC .DOC_DESCRbC C .DOC_EXECbM C .DOC_CLASSbM C.DOC_NEWbL C .DOC_OPENbL C .DOC_SINGLEbL C .DOC_NOSHOWbL C .DOC_WRAPbL C.DOC_GObL C.DOC_NAVbL C .ALT_EXECbM % ?T"Metatable has incorrect structure:C C  %]%CEXACTvOFFDG T a TCW F  T DOC_OPENT DOC_NEWT  DOC_DESCRT DOC_TYPET  DELETED()  CV (CV.T CC mf (C T C CC f%  T-!% 8TOne or more of required indexesC is missing from your metatable:C C C C C C C C C C  % OG F%  %CCCx!C: %C Q BUTCTABLETLOMITFEEDBACKTHIS CMETATABLELCTABLE LCMESSAGELCALIASLISELECTLLRETURN LITAGCOUNT LAREQUIREDLAKEYSLIFOUND LLEXACTOFFCLEARLASTERROR ISERRORFREE STARTMODECCAPTIONCUSERRORRECORDSERVERERRORX &TC .fxp .prg%C C _T.T.,T.T.,[],[]"TC%C HC %C C T%C C DT BU LOSESSIONLCPASSTHISCSESSIONCLASSLIBGETRESOURCEFILENAME CSESSIONCLASSADDCOLLABORATORCMEDIATEDSESSIONCLASSCMEDIATEDSESSIONCLASSLIBLOADAPP CREFERENCET  %CTah3%COC DataSessionIDh . %Ca-d H` Ca- Ca- 2`%C- \ %QT-B-(CpTC3%COC DataSessionIDh .)%CloCollaborator.ParentbOC  M%CReleasehI C TT %T-BCUTLFORCELOCOLLABORATOR LIMEMBERINDEX LLINTERRUPTEDTHIS LNOINTERRUPTACOLLABORATORS DATAREVERT&IQUERYUNLOADRESULTFORNONVISUALSESSIONS DATAUPDATEQUERYDATASESSIONUNLOADPARENT REMOVEOBJECTNAMERELEASE ISERRORFREE#%CL  p %UTlTTUTVNEWVALTHIS LNOINTERRUPT TMRREFRESHINTERVALIREGULARINTERVAL%C B-"TC.icoa,TC.bmp .ico .gifa&%CC C  T%C B-5%Ch C CfCf T aBC U THISCICONGETRESOURCEFILENAMECIMAGE CREFERENCESETAPPFILENAMES STARTMODECCLASSCONTAINERFILENAME CAPPFILENAME LREADEVENTS ISERRORFREE) CTa %C C  K < <CaCaCaCa C C C %C Q %  C%C  <CaUTHIS LNOINTERRUPT CFRAMECLASS CGOMENUFILE_MSM_GO_MGORELEASECONTEXTMENUSRELEASESESSIONS RELEASEFORMSRELEASETOOLBARSRELEASECOLLABORATORS RELEASEFRAME CLEAREVENTSCUSERTABLEALIASLRESTOREDENVIRONMENTRESTOREENVIRONMENT CREFERENCEHANDLEPROJECTWINDOW%C $B-%C EB-TaCC C C C <U TLFORCETHISRELEASESESSIONS RELEASEFORMS LNOINTERRUPTRELEASECONTEXTMENUSRELEASETOOLBARSRELEASECOLLABORATORS RELEASEFRAME CLEAREVENTST%3BC     TCT C%  t T  T T Ct +aHT C tT  T C t,%C C fC.ERRORf D!(T C fC .READEVENTSf H   %TON ERROR &lcTemp  C X2BUNERRORCMETHODNLINETHIS ILASTERRORLSKIPERRORHANDLINGCUSERRORHANDLELLFATALLLUSERCANCELLEDLCCALLERLCPROGLLNOCODEEXECUTINGLILEVELLCTEMPISFATAL USERCANCELLEDNAME LREADEVENTS CLASTONERRORRELEASEshow,doformAdoreport dolabeldomenu clearevents readevents doprogramsaveenvironment\restoreenvironment6filenotfoundmsgboxw onshutdown releaseformsD releaseform#resetformscollection $refreshformscollection$refreshtoolbars& dotoolbar'releasetoolbarl+releasetoolbars-releasecollaboratorsG/createcollaborators0 instantiate0getcurrenttopformref*7 iserrorfreeo7clearlasterror7getresourcefilename7setenvironment/; donewopen^=displayerrorlogC> beforedoform?querydatasessionunload'@setappfilenames7Bquerydatachanged(D dataupdateE datarevertUFccaption_accessGccaption_assignG cicon_assignFHilasterror_accessHcdatafolder_assignHcreference_assignvIcappfolder_access~Jlgomenu_assignLdoreportdialogO doaboutboxOdooptionsdialog.P docontextmenuQreleasecontextmenuUdohelpgWdomodaldialogclassZ cascadeformM\ cascadeall ]dosortc]gotop]gobottom;^gonext^ goprevious^showtablegotodialogU_showtablefinddialog_showtablesetfilterdialog`releasecontextmenusasetdatasessionenvironmentcsetdatasessionsetsc cimage_assignccerrorlogtablename_accesstdaddcollaborator)egetformmediatorreffformisframeworkenabled:i createframei releaseframejsetscreenattributesksetframeattributeslshowstartupelementsimactivatesystemwindow(pdomenuiteminframeqlnavtoolbar_assignq gotorecordxsgetcurrentaliass dotableoutput(tcusertablename_accesszcusertablealias_assign |setcurrentuser| dostartupformiinitialtoolbarposition_assigncaboutboxclass_accesscstartupformclass_access cstartuptoolbarclass_access6dodocumentpickerdialogsetuserpermissionsseekcurrentusercreateusertable douserloginfilluseroptionsarrayapplyuseroptsforsessionЊseekdefaultuserapplyglobaluseroptionsԎgetuseroptionsetting purgeerrorlogqexporterrorlog>refreshfavoritepopupjctextdisplayfont_assignseekmetatablefavoriteid setmacrosLsetcurrentuserfavoriteidsudofilenclearfavoritesg storepasswordcreatestoredpassword checkpasswordcheckvalueagainststoredpasswordFlusercanchangepassword_accesslusercanchangepassword_assignܲdochangepassword%handleprojectwindow doformnoshowBsethtmlstyleid| sethtmlclassactivateƷactivateforminframeCcreateformmediatorsvalidatemetatableaddmediatedsessionreleasesessionslnointerrupt_assignbInit7Destroyrelease#Errord1qBBABBBBBb1BBBRB3rAqAbAA1qAAAAq1ARABu"RS1ABACS1AA "QQ1AAAB%AA!AAAA!AAAAAAA1DB4rqARqA]3"qQ1QAAA2A`qQAAaaAAA2 AqAA3qAqA!AR4rqAqAA4QA6QA7qrqAqAcaaqAA4aqrBB4qArqA"QAqAB3qrCB3qbA"AEAABAAA3qrBAA2"A"3AAAqAqAABVAAqAABA2qaAQAA43QAAAqAAA1AAA3BAr!QAA3AAQqTAAbAAAaAAQA!A4@qArAAA4q"ARrAqAAAA4QQ1aAAAAA33vRQAABbAqAcaaqAARQQA1AAaAA443301AA1qaAq!A1qa!AQAAABrA3qaAaARBAD4qq!32RRBBA45r"AABA3AA1A1AAAaAAA4"AA41"ABA31"ABA3A4qQA4!A33qr4qRAB1B3rBAEABA3q"qAA!1aAAcBAbQABA3qr6q22AAA9sAAQqSAAAAAaA3qArA1Aq4A4q!AqAqA"A1aaqAqqARCS5qAAARqA!1AArB4qqa!qA4qB4124444q4Q1"AAqA3qQ1qA4qRrqAAA3qqQA4aa5"A5qqAAqQA3"AB#2qAaAAA%AAAAbRBaA4qQ5q2A21AA2A2qr"R2BBtAD7BAaa4qAr#qsBBBbBAB3qAArAA6qAAA4q"qAAqAAAaAAA3qA42xbQAq!QARAAA"FA1AABBTAR11BABRAA2q!qAAqQABA3qB3q21qAAAAAAA3q7A3qA5B33B3qAAAR!1AAqA64q;RA21qAAaASAaAA3qXA3$qAqQqA22A2qQAA!AAAQAA22AQAAABAB3v21qAAbQAAA41AAQAA1AQAAABB3RqAqA!AAaABaAqqA31AAAQqAAARaAAaABB!AB3AAAQA2AAFR11A"BA3qASAA2QA2AAA3R!q2!S! BAArAAAAA5qAARRQAAAB3rqA5qAA2AAR1QQBABAQAAAA3q1AAAQ4 BAA!QAAAABTAAABA4qAqARqA1AAQQQbQDQQQTBS"B4A2qrB3u4qrB3QqAE23"3!rAqA2AA9qtBBBE3q!AqA2333qAdABABABB6qqADsBrA1qA3qAtRqAAAAaArqAAAA AaABbqQAAA4bA"11A1AB4q"A"3AA1A1A1qAqAAABR3AAaAAABA3q3AAB4qA"b1A"qASA4A"AA2A3qcqAbqAs4EABAbAAAAAEqEAAA3L,iU34n66889 <99!9=#8>A@THj@CncCEj0EMIpIN=NYOOO+PR2RSMSZ[Zb4bXeLeg^hj`"jv*w:w\w~wwww*n5 X4=^&c@ړL;Xdؘ2jXϙqxz˛ ѝ4/Yu`$J< ι  7GAQreskpsdvz>~[HTh)0<Hj6Jt2&[F-pNF? ^nZ d c ~  `   & cZ Up { % , '^ - F_ GF  fl  u% `7 +B Qs  !  L " "& ', J,+:M Y:; ;= =B BQP nPEYz <jYbZ @Z[ F[\ J\^ U _3`[g``]``a#`a]d)sdgO=ghphh}i%iDiiimn~rr%~ N~l% ǂlU a Ԋpq _ }œ8 qP)l SShf%U$ CU TCTABLENAMETCALIASTHISPARENTCERRORLOGTABLENAMEc T TC%C STC  BULCTITLE LCCAPTIONTHISPARENTCCAPTION:TCUNERRORCMETHODNLINETHISPARENT ILASTERRORsetlog,getmessageboxtitleError1b51A41Q3pJ f)S %<KU%B CC&%C_SCREEN.ActiveFormbOxT9J-( B6%C loForm.ParentbOC  B% BTC9 %COWTT  zJ-( U THISPARENT LNOINTERRUPTREFRESHTOOLBARS LOMEDIATORLOFORMLLBUSY ACTIVEFORMLGOMENU LNAVTOOLBAR WINDOWTYPEGETFORMMEDIATORREFTimer,11BAaAAbAAAAAQaaA6*)